-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Change File Name and Path #1128
Comments
In case you are using php you can change the filename and upload directory in server/php/upload.class.php upload dir: In the constructor function change the options: upload_dir and upload_url filename:I would make a hidden field in the form which passes the session_id. Then in upload.class.php / function trim_file_name you can set the passed session id as filename: $file_name = $_POST['session_id']; |
excellent answer, got it working well. thank u they should put this into the FAW's since i am sure this is the 1. or 2. question for most |
Hi, I have tried this to try and set the file name, but it just seems to append the existing filename onto what you set. For example, I changed the options in the constructor to: 'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'../example/inv/myfile.pdf', ...where I want the file to be named 'myfile.php', but it just uploads the files as: ...../example/inv/myfile.pdftestpdf.pdf The file I uploaded was named 'testpdf.pdf'. Do you know how you can make it write over the existing file name and ensure it is saved as the one set in the constructor? Thanks |
change ME']).'../exa to ME']).'/../exa On Thu, Nov 15, 2012 at 2:20 PM, tmcnicholl notifications@github.comwrote:
|
This is a real problem :/ I'll test Uniqid() |
protected function trim_file_name($file_path, $name, $size, $type, $error, .... end of line
|
Hi,
I just want to specify a new file name for the uploaded files. I can pass this on the same page I have the form.
For example using their sesionid via php.
23541342534534534534.mp instead of "in da club.mp"
How can I pass this custom file name to the script?
Bonus: How can I change the upload directory from the html form page ?
The text was updated successfully, but these errors were encountered: