Renaming file names when file uploading |
[eluser]shankar ganesh[/eluser]
The below code for uploading and renaming files, how to rename files when uploading files and not after uploading. Code: $this->load->library('upload');
[eluser]Unknown[/eluser]
Refer to the file uploading class in the user guide. You can specify the new name of the file in the config. Code: $config['upload_path'] = 'upload/images/';
[eluser]SPeed_FANat1c[/eluser]
I have one question about this $config['file_name'] = 'yourfilenamehere'; I rename it to let's say photo.jpg (I have to add extention, becuase othervise it does not allow to upload). But when png file is uploaded, it also is renamed to 'photo.jpg'. Not a big problem, I can still use those files, but is it good practice to do so? |
Welcome Guest, Not a member yet? Register Sign In |