08-29-2008, 08:31 PM
[eluser]neosable[/eluser]
How do I set the name of the file when using the file upload class?
thanks
How do I set the name of the file when using the file upload class?
thanks
File uploading save file as
|
08-29-2008, 08:31 PM
[eluser]neosable[/eluser]
How do I set the name of the file when using the file upload class? thanks
08-29-2008, 09:44 PM
[eluser]Colin Williams[/eluser]
Are you familiar with how PHP handles file uploads? It saves the posted files to a temporary folder and then it is up to the given script to move those files over to a permanent location. CI's file uploading simple mitigates that process through a clear API. So, just rename the file(s) after "uploading" them. Use the [url="http://us2.php.net/rename"]rename()[/url] function, believe it or not! ![]()
08-29-2008, 11:21 PM
[eluser]neosable[/eluser]
so basically instead of saving the file to windows/temp (in case of windows user) CI saves the file to the folder I set in the configand then I have to move it .
08-29-2008, 11:26 PM
[eluser]Colin Williams[/eluser]
Oy.. no, CI moves it to $config['upload_path'] By the way, someone just extended CI's uploader class to allow for custom renaming, which he claims is set up to automatically handle filename clashes.. check it at http://ellislab.com/forums/viewthread/89603/ |