Hi,
I'm trying to change the name of the file that gets uploaded using the CF upload element
Basically, I want to convert the filename to md5 hash, and add some other variable info, then add the .jpg (we're limiting pics to .jpeg only)
can I do something like:
In older versions of CF there was a "Filename Format" parameter for file uploads, but I don't see it in v4
I wanted to check in to see if anyone has dealt with something like this?
Thanx
Mark
I'm trying to change the name of the file that gets uploaded using the CF upload element
Basically, I want to convert the filename to md5 hash, and add some other variable info, then add the .jpg (we're limiting pics to .jpeg only)
can I do something like:
<input type="text" value = "md5('' + <?php echo $my_variable;?>) + 'some other info'">
?In older versions of CF there was a "Filename Format" parameter for file uploads, but I don't see it in v4
I wanted to check in to see if anyone has dealt with something like this?
Thanx
Mark
Update
So I found Bob's action plugin here:
http://greyhead.net/how-to-docs/cfv4-upload-files-gh-action
I installed it but can't seem to get the syntax right -
It works fine using {file_name} (nice, by the way)
And I've tried hacking upload_files_gh.php by adding md5(), etc,
but no luck so far...
So I found Bob's action plugin here:
http://greyhead.net/how-to-docs/cfv4-upload-files-gh-action
I installed it but can't seem to get the syntax right -
It works fine using {file_name} (nice, by the way)
And I've tried hacking upload_files_gh.php by adding md5(), etc,
but no luck so far...
I think I found it but I"m too tired to test it...
Added md5 to the following in upload_file_gh.php:
Added md5 to the following in upload_file_gh.php:
$curly_array['file_name'] = md5(JFile::stripExt($file_post['name']));
Hi Mark,
Hacking that line will probably do the trick. A 'tidier' way might be to use a Custom Code element to get the file name before the File Upload and write the hashed value into the $form->data array so that you could use {hashed_name} in the File Name box. I think that's possible.
Bob
Hacking that line will probably do the trick. A 'tidier' way might be to use a Custom Code element to get the file name before the File Upload and write the hashed value into the $form->data array so that you could use {hashed_name} in the File Name box. I think that's possible.
Bob
This topic is locked and no more replies can be posted.