Modify Upload to make a new folder per Upload

Home Forums Quform WordPress Modify Upload to make a new folder per Upload

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  MoritzK 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23562

    MoritzK
    Participant

    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 9 months, 1 week ago by  MoritzK.
    #23627

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #23643

    MoritzK
    Participant

    Hi 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
    Moritz

    #23644

    MoritzK
    Participant

    ok 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 9 months ago by  MoritzK.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.