Home › Forums › Quform WordPress › Modify Upload to make a new folder per Upload
- This topic has 3 replies, 2 voices, and was last updated 6 years, 3 months ago by MoritzK.
- AuthorPosts
- December 15, 2017 at 1:21 pm #23562MoritzKParticipant
Hello there,
Since my Form containts more than 1 Uploadfield and allows multiple uploads I want to group the upload in folder per submited form. I have a “Projekt” Input in my Form so I might want to use this Inpute(since it is requierd as folder name) . If this is not possible it should be fine if i can add hours,minutes and seconds to make the uploads get grouped depending on their upload time.
Best regards
Moritz Kiehl.- This topic was modified 6 years, 3 months ago by MoritzK.
December 20, 2017 at 10:52 am #23627AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
December 20, 2017 at 12:07 pm #23643MoritzKParticipantHi and if i know want to ad the date infront of the $value should i do it with
return “HochgeladeneDateien/date(‘Y’)/date(‘m’)/date(‘d’)/$value/”;
Regards
MoritzDecember 20, 2017 at 12:46 pm #23644MoritzKParticipantok i solved it by creating a plugin and then adding this to it:
add_filter(‘quform_upload_path_1’, function ($path, Quform_Element_File $element, Quform_Form $form) {
$value = $form->getValueText(‘quform_1_9’);
$value = sanitize_file_name($value);
$date = getdate();
$year = $date[‘year’];
$month = $date[‘mon’];
$day = $date[‘mday’];
return “Dateiupload aus Formular/$year/$month/$day/$value/”;
}, 10, 3);- This reply was modified 6 years, 3 months ago by MoritzK.
- AuthorPosts
- You must be logged in to reply to this topic.