Hi @schumiholic,
There isn’t any direct option to change the folder location where the uploaded files are saved but you can change that using custom codes..
If you want to change the file upload location then you can do that using the filter hook –
add_filter('fluentform/file_upload_options', function ($locations){
// Do your stuff here
}, 10, 1);
Thank you!
Where do I add this code, in the functions.php file? And how do I add the location in the format ‘example.com/upload-folder’?
I’ve been trying to adapt the code to my needs, but something is not working right. What I am trying to achieve is for a specific form (id 7 in this case), the images to upload in a specific folder (competitions in this case). The if function is not working. Can you please tell me what I need to modify?
add_filter('fluentform/default_upload_path', function ($path, $form) {
$form_id = $form->id;
if ($form_id == 7) {
return wp_upload_dir()['basedir'] . '/competitions';
}
return $path;
}, 10, 2);
Hello Schumiholic, sorry for delay. Somehow $form->id was null when uploading file or image, we will fix it our latter release. If possible just make it’s simple, forget about form id condition and make sure File Upload Location is set as “Fluent Forms Default”. If it’s mandatory to check ($form_id == 7) you can create a support ticket here to get fixed version.
add_filter('fluentform/default_upload_path', function($path, $form) {
return wp_upload_dir()['basedir'] . '/competitions';
}, 10, 2);