CFv4 Upload Filename Format

Ravens 05 Sep, 2011
In CFv3 we could change the format of the name of files that were uploaded so they did not contain the date and time stamp. Where can I do that in CFv4? I want the name to stay the same as what the user uploads.

Thanks
Tami
GreyHead 05 Sep, 2011
Hi Tami,

I don't know how to do that with the standard action.

You could try my custom Upload FILE [GH] action - that give you more control.

Bob
Ravens 05 Sep, 2011
Ok, so I've downloaded and installed your custom upload file. How do I set the filename in it?

Tami
Ravens 05 Sep, 2011
I figured it out. It was really simple. I just put the field name in curly brackets in the "filename" field on your form and it worked perfectly.

Thanks again,
Tami
Ravens 06 Sep, 2011
For whatever reason, this has stopped working. I have a file field on my form named "receipt". I put {receipt} in the filename field of your form. It worked several times, but now it is changing the name of the uploaded file to "receipt". Any clue what I might have done?
GreyHead 06 Sep, 2011
Hi Tami,

I suspect that this may be linked to the code in the other thread where you are setting a default value for receipt???

If receipt is showing up then the value of $form->data['receipt'] is almost certainly set to 'receipt'.

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