I'd like to change the file name when I use the upload class to upload the file.
How should I do?
The only way I know how to do that is to change the filename in your PC before uploading
I don't believe Open Cart has the feature to change filenames
If you have a bulk lot of files and you want to add/change something standard about them, go google and find Advanced Renamer. It allows you to bulk change filenames.
eg. your files are blue_balls_large, pink_balls medium, green_balls_small
You can use advanced renamer to change it to be balls_large_blue, balls_medium_pink, balls_small_green.jpg etc etc. in bulk lot
or search google for a file renaming tool. There are free ones out there.
I don't believe Open Cart has the feature to change filenames
If you have a bulk lot of files and you want to add/change something standard about them, go google and find Advanced Renamer. It allows you to bulk change filenames.
eg. your files are blue_balls_large, pink_balls medium, green_balls_small
You can use advanced renamer to change it to be balls_large_blue, balls_medium_pink, balls_small_green.jpg etc etc. in bulk lot
or search google for a file renaming tool. There are free ones out there.
depending on what you want to rename, you could change it here:
/library/filesystem/upload.php
That would rename the file to a random number. Depending on what you want to change it to, will depend on where you make the change
/library/filesystem/upload.php
Code: Select all
function save($key, $file) {
[color=red]$file = rand(5, 15); [/color]
if (file_exists($file)) @unlink($file);
$status=@move_uploaded_file($_FILES[$key]['tmp_name'], $file);
if ($status) @chmod($file, 'a+r');
return $status;
}
Code: Select all
function save($key, $file) {
[color=red]$file = ($file) . (time() + microtime());[/color]
if (file_exists($file)) @unlink($file);
$status=@move_uploaded_file($_FILES[$key]['tmp_name'], $file);
if ($status) @chmod($file, 'a+r');
return $status;
}
Who is online
Users browsing this forum: No registered users and 33 guests