PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Changing location of the file upload and save files in the folder

  1. I changed the file location in the functions.php of my theme like this:
    add_filter ("gform_upload_path", "change_upload_path", 10, 2);
    change_upload_path function ($ PATH_INFO, $ form_id) {
    $ PATH_INFO ["path"] = "/ wp-content/uploads /";
    $ PATH_INFO ["url"] = "http://www.jogoscelular.net/wp-content/uploads/";
    return $ PATH_INFO;
    }

    I've managed to create the folder gravity_forms but the image file and another extension. Jar not write to the folder.
    Give these two errors:
    Warning: copy () [function.copy]: Unable to access FAILED (Upload folder could not be created.) In / home / public_html / wp-content / plugins / gravityforms / forms_model.php on line 1701

    Warning: copy (FAILED (Upload folder could not be created.)) [Function.copy]: failed to open stream: No such file or directory in / home / public_html / wp-content / plugins / gravityforms / forms_model.php online 1701

    How do I?

    Sorry English by Google Translator

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  2. Gravity Forms already stores files in the wp-content/uploads folder, is there any reason why you are using the hook to set this information to the location that Gravity Forms already uses?

    One thing to note is the path has to be the full physical path. What you have appears to be the path from the root of your WordPress install. That isn't the full physical path which is likely longer. You need to double check the path and make sure that you have the correct full physical path to the correct folder.

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  3. Yes I changed the default path of wordpress, all files are hosted on /images with additional domain images.jogoscelular.net.

    The path of the filter functions is correct and the problem persists.

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  4. If this is your path:

    $ PATH_INFO ["path"] = "/ wp-content/uploads /";

    It is likely not correct, unless you have an unusual server setup.

    That doesn't look like a full physical server path, it looks like a path where it is assumed that it begins at the WordPress root or your site root. Which typically isn't the case. The path must be the full physical server path beginning at the root of the server, not your site itself.

    Even the paths in your error messages go back further than that based on the error messages you posted above. For example: /home/public_html /wp-content.

    If the path was correct, and the file permissions on that folder were correct, that filter would work. So if it is not working then either the path is not correct or the file permissions for that folder are not correct.

    Posted 13 years ago on Friday December 23, 2011 | Permalink
  5. In the functions looks like this:
    add_filter ("gform_upload_path", "change_upload_path", 20, 2);
    change_upload_path function ($ PATH_INFO, $ form_id) {
    $ PATH_INFO ["path"] = "/ home/jogoscelular8/public_html/wp-content/uploads /";
    $ PATH_INFO ["url"] = "http://www.jogoscelular.net/wp-content/uploads/";
    return $ PATH_INFO;
    }

    I made the changes recorded and it worked, but still the error:
    Warning: copy () [function.copy]: Unable to access http://www.jogoscelular.net/wp-content/uploads/name-image.jpg in / home/jogoscelular8/public_html/wp-content/plugins/gravityforms / forms_model.php on line 1701

    thank you

    Posted 13 years ago on Monday December 26, 2011 | Permalink
  6. The $PATH_INFO["url"] should correspond to the public URL where the images are stored. Likely http://images.jogoscelular.net/ NOT http://www.jogoscelular.net/wp-content/uploads/

    The path is the file system path and the url is the publicly accessible URL where the files can be found.

    Posted 12 years ago on Tuesday December 27, 2011 | Permalink