Dynamic Name.... File Upload

karmine 01 Feb, 2010
I have create a Form with WIZARD FORM, this form have field "file upluad" and the name of file is

$filename = date('YmdHis').'_'.$chronofile['name'];

I can add at this field another from my form... example: email field?
$filename = date('YmdHis').'_'.$chronofile['name'].?email?;


Grazie GrayHead!
GreyHead 01 Feb, 2010
Hi karmine,

Yes and no. It's possible to add another field from your form but some characters - like '@' or space aren't valid in filenames (or not safe at least).

To add a field value use JRequest::getCmd('field_name', 'blank', 'post') in the string. This will remove most 'bad' characters and make sure the result isn't empty.

karmine 02 Feb, 2010
BEh...Thanks for your quick response
zest96 25 Feb, 2010
Hi Bob,
Can you write the whole string here for file upload dynamic naming? I'd copy paste it and change the field :wink:

Is it possible to keep the name if it's in hebrew characters (UTF8)? ( currently it drops off 😢 )

GreyHead 26 Feb, 2010
Hi zest96,

Hmmm . . . the question only makes sense if you say what you want in the filename. There is an example in the box on the File Uploads tab.

I've no idea if you can get Hebrew characters in there; certaily getCmd() will filter them out, getString(), or getVar() should let them through.

This topic is locked and no more replies can be posted.