$config['file_name'] allows us to set the filename, while uploading files in CodeIgniter. Here we need to write the filename with the file extension. For example, filename.pdf or filename.zip. I want to set the filename, but the extension. So, if someone uploads a pdf file, the filename will be myfilename.pdf. And if someone uploads a zip file, the filename will be myfilename.zip.
$config[‘file_name’] allows us to set the filename, while uploading files in CodeIgniter. Here we
Share
start off the upload stuff in your controller like this and you can name it whatever you want. just replace ‘new_file_name’ with whatever you want it to be called. Make sure you change the do_upload() function variable to the name of your file input as well.