• Resolved wp_user1

    (@wp_user1)


    Hey, we use forminator for a long time and it always worked fine.

    After last update files are not moved from the temp folder to uploads directory root, how we need it.

    How can we change this?

    So at the moment the files are in /wp-content/uploads/forminator/234_15f79090cc183d5c53f2ec82d3fab36f/uploads/

    but they sould be in /wp-content/uploads/ after submitting.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @wp_user1

    I hope you’re well today!

    This has been changed since 1.23.3 version (released in April 2023) and is due to security-related changes.

    But you can change the upload path in plugin setting on the “Forminator -> Settings -> Data” page.

    There’s a “File Upload Storage” option there which you’d need to switch from “Default” to “Custom” and this will let you set different/custom path to store files in .

    Kind regards,
    Adam

    Thread Starter wp_user1

    (@wp_user1)

    That does not work (anymore?). When I enter an empty file path (to load to /wp-content/uploads/) and save this, after reloading, the field is filled with “forminator” again.

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @wp_user1

    It should be working and I just tested it on my end – I can’t replicate such behavior.

    Please try instead putting just “/” there and that should already set it to “/wp-content/uploads”.

    But if “forminator” gets back there after saving settings it would mean that most likely there some kind of object cache involved and it’s just that the data is not correctly updated in or read from DB due to caching. You may need to fully purge all the cache – especially server-level.

    If you are not sure about server-level cache, please ask your host how to purge it. That’s especially important if there’s object cache active as this is the kind of cache that is storing responses to DB requests – and often affects this kind of options.

    Kind regards,
    Adam

    Thread Starter wp_user1

    (@wp_user1)

    It was not a caching problem. Perhaps an empty field is not accepted. When I filled in the “/” it saved (see https://ibb.co/7VDNdyW)

    We have no caching plugin installed.

    But – even after saving, the file upload stays like that:

    /wp-content/uploads/234_15f79090cc183d5c53f2ec82d3fab36f/uploads/117-Audio.mp3

    Before updating the plugin it worked fine :/

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @wp_user1

    Yes, that change will still not override those additional subfolders. It will only change the “main” location/path under which those subfolders are created.

    If you need to change that as well then in addition to change already made (the changes patch setting), you’d need to add additional code to the site:

    `<?php
    add_filter( ‘forminator_custom_upload_subfolder’, function( $sub_folder, $module_id, $dir ) {

    $custom_folder = “somefolder”;

    return $custom_folder;
    }, 10, 3 );`

    You can add it as MU plugin:

    – create an empty file with a .php extension (e.g. “forminator-change-upload-path.php”) in your site’s /wp-content/mu-plugins folder

    – copy and paste code into it and save the file

    In this line

    $custom_folder = "somefolder";

    you can define your custom subfolder. With above example (and custom path set in plugin settings to /wp-content/uploads), image would land in

    /wp-content/uploads/something/

    folder, without any additional subfolders.

    Kind regards,
    Adam

    Thread Starter wp_user1

    (@wp_user1)

    I guess we already hat this in past but the file disappeared (because of the update?).

    t worked with class Change_Forminator_Upload_Dir … but this seems to be outdated?

    • This reply was modified 8 months ago by wp_user1.
    Thread Starter wp_user1

    (@wp_user1)

    Another bug occured now:

    Forminator loads a .htaccess file to the upload folder. This htaccess disables handling of php files. So php files are just loaded as source code from upload folder..

    • This reply was modified 8 months ago by wp_user1.
    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @wp_user1,

    But – even after saving, the file upload stays like that:

    /wp-content/uploads/234_15f79090cc183d5c53f2ec82d3fab36f/uploads/117-Audio.mp3

    I checked further regarding this, I’m afraid due to security concerns the folders can no longer be created within /wp-content directory.

    It’ll only be created inside /wp-content/uploads/forminator directory, which is the expected behiavour.

    Due to recent updates in the plugin, the given snippet will also be creating the folder inside the /wp-content/uploads/forminator folder.

    I’m afraid, it isn’t possible to change the existing behaviour at the moment.

    Forminator loads a .htaccess file to the upload folder. This htaccess disables handling of php files. So php files are just loaded as source code from upload folder..

    The .htaccess files created are expected. Just to be sure, do you mean you face issues with styles not loading in the form?

    What happens if you remove the following line from the .htaccess:
    Options -ExecCGI

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter wp_user1

    (@wp_user1)

    We solved it now and moved the php files to another folder.

    Thanks!

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @wp_user1,

    Glad to hear its working. However, there is a correction from what I have stated in the previous response, just making that part clear.

    <?php
    add_filter( 'forminator_custom_upload_subfolder', function( $sub_folder, $module_id, $dir ) {
    
    $custom_folder = "something";
    
    return $custom_folder;
    }, 10, 3 );

    If you are using the above snippet then change the “Custom Path” as below:

    Screenshot at 14:24:25.png

    It should help with changing to folder name from “forminator” under /wp-content/uploads/forminator to /wp-content/uploads/something/

    Sorry for any confusion from my side.

    Kind Regards,

    Nithin

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Move files to uploads folder’ is closed to new replies.