How do we name the file uploads with V5? With version V4 we could use the file upload GH action. I need the file name to have a set title based on a form field [title]. I have tried to make it just the file name without the date but it returns errors.
Brad
Brad
Hi Brad,
If you scroll down the Files Upload action settings there is a 'File Name Code'box where you can set a custom name.
Bob
If you scroll down the Files Upload action settings there is a 'File Name Code'box where you can set a custom name.
Bob
Bob,
I have tried the file name box. I modified the default code to remove the date <?php return $filename; and I get the error attached.
I have tried the file name box. I modified the default code to remove the date <?php return $filename; and I get the error attached.
Hi Brad,
What did you replace the date code with? If you left it blank then I think that you are creating (or trying to create) files with no name.
Bob
What did you replace the date code with? If you left it blank then I think that you are creating (or trying to create) files with no name.
Bob
Bob,
The default code returns the current date and the existing file name. So If I upload a file called test.pdf it saves it as 201507010841_test.pdf. I am looking for it to only save the file name test.pdf. so I deleted the date field and left the rest of the code.
The only code i am putting in the box is <?php return $filename;
The default code returns the current date and the existing file name. So If I upload a file called test.pdf it saves it as 201507010841_test.pdf. I am looking for it to only save the file name test.pdf. so I deleted the date field and left the rest of the code.
The only code i am putting in the box is <?php return $filename;
Hi Brad,
I think that needs to be
Bob
I think that needs to be
<?php return $file_name;with an underscore.
Bob
This topic is locked and no more replies can be posted.
