Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: Jul 26, 2006, 04:23:12 pm »
Hi! Thanks for the snipplet. I'm trying out multiple uploads using the example provided. I would like to rename the uploaded file by adding a prefix "abc_". I tried to work on the part where we rename filename to date stamp by changing strtotime("now") to $prefix.$the_file. The prefix shows up but not the original filename. What variable should I use for the original filename?
Code:
function set_file_name($new_name = "") { // this "conversion" is used for unique/new filenames if ($this->rename_file) { if ($this->the_file == "") return; $name = ($new_name == "") ? strtotime("now") : $new_name; sleep(3); $name = $name.$this->get_extension($this->the_file); } else { $name = str_replace(" ", "_", $this->the_file); // space will result in problems on linux systems } return $name; }
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374