This extension offers commonly used functions for filesystem objects (files and directories) manipulation. Can be used separately from Yii.
Repository at GitHub ¶
Documentation, changelog, issue tracker and more are at CFile project repository at GitHub
CFile exposes:
Properties ¶
- exists
- isdir
- isfile
- isempty
- isuploaded
- readable
- writeable
- realpath
- basename (setter available)
- filename (setter available)
- dirname
- extension (setter available)
- mimeType
- timeModified
- size
- owner (setter available)
- group (setter available)
- permissions (setter available)
Methods ¶
- Create
- CreateDir
- Purge
- Contents (get; set for files, append possible; contents filters for directories)
- Copy
- Rename/Move
- Send/Download ('x-sendfile' header support)
- Delete
Total 20 comments
Support for FTP and other protocols is native in PHP at most file-operating functions. See "Supported Protocols and Wrappers". This means, that you should be able to simply use any of supported protocols (for example
file://) when specifing file name viaCFile->filename.CFileis currently based onCApplicationComponent. Consider, if you could base it onCFileHelper. This way users of your extension can have access to functions offered by both file-related classes.Hi when i use cfile it takes time to copy and sometime error shows Maximum execution time of 30 seconds, how can i speed up copy? also it needs to refresh if loading is stop to continue the copy. and how can i put an ajax their or i want that something loading .gif is show while it still copying????
on the other hand, it cool extension.....
good extension! It would be cool to add FTP support as all used php functions support it now.
Same here : NEKUDOTAYIM etc ... error on win platform - php 5.2.11
But I have an issue on the Linux server (on Win localhost works), maybe it's the PHP version: Unexpected T_PAAMAYIM_NEKUDOTAYIM CFile.php lines 215 and 216. Now working with $this instead of ::
Thank you!
I couldn't get this extension to create a directory with the correct permissions on my production server, not 100% sure why. Safe_mode is off.
I tried this
But no joy! After much hair pulling I did this based on info from php.net and from looking at the Yii assets manager code.
I don't know if others have had this problem.
Sorry, that was supposed to look like this
Documentation (above) says: If CFile::download() second parameter ('serverHandled') is set to True...
Why not detect it within the method? [code] $xsendfile=(in_array('mod_xsendfile',apache_get_modules()))?true:false; [/code]
Hi idle,
I have one suggestion. What do you think about disabling file size formatting while $greedy parameter of "set" function is "true" ? Now autoloaded file data contains formated size by default ...
Regards, gawronzo
Sir, you saved me a lot of time with this stuff.
Gracias!
Thank you for the work, that' really a good extension.
Hello. Trying this....
I get follow errors:
Great extension!
Really usefull and handy. Thanks a lot.
Really useful.
Very usefull, saved me a lot of time :)
@jackiesun: As free as in beer, why would you think it is not? :)
is this free?
Leave a comment
Please login to leave your comment.