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.

Upload path returning error

  1. im trying to change the path for uploading and I keep getting these 2 errors.

    this happens after the script is done loading the file using ajax.
    Warning: Missing argument 2 for change_upload_path()

    then it redirects to the post and I get this error where my picture is suppose to be.
    <img src="FAILED (Upload folder could not be created.)">

    and this is the code im using...
    add_filter("gform_upload_path_2", "change_upload_path", 10, 2);
    function change_upload_path($path_info, $form_id){
    $path_info["path"] = "/public_html/pics";
    $path_info["url"] = "http://www.mysite.com/pics/";
    return $path_info;
    }

    I dont know but ive tried many different ways and I keep getting those errors. And I have both files on 755

    Posted 8 years ago on Tuesday October 18, 2011 | Permalink
  2. I've had this exact issue in the past, and it was the ownership of the directory. This is going to be related to the server configuration, and what user writes the files and what user owns the directories.

    Does the pics directory exist? What are the permissions and ownership of the directory?

    Also, do you have access to any sort of web server logs that might point to the reason for the permission errors?

    Posted 8 years ago on Tuesday October 18, 2011 | Permalink
  3. Yes I created the directory it has permissions of 755 and i also tried 777. I dont have access to any server logs I cant seem to find them on my server.

    Posted 8 years ago on Tuesday October 18, 2011 | Permalink
  4. anyone have any suggestions?

    Posted 8 years ago on Wednesday October 19, 2011 | Permalink
  5. Without access to logs, it's going to be difficult to see why it's failing. So, we would just be guessing. There can be security restrictions on the user that runs WordPress or the web server, or ownership problems. The directory permissions are pretty open, so I don't think that's it. Can you contact someone at your host to help you locate the logs?

    Posted 8 years ago on Wednesday October 19, 2011 | Permalink
  6. Anonymous
    Unregistered

    Not sure if you've solved this, but i've had this problem too and it relates to what Chris Hajer said.

    From what i've found when Gravity Forms creates its own directory it does so using the server so it has the correct, server owned status. (Probably called 'nobody' - this is actually the server).

    When you create your own new directory, you'll need to CHOWN the directory from the command line of the server itself so that the server (apache or 'nobody') is the owner of the directory. This should then allow the owner (the server) to write to this directory.

    The Permissions will probably also need to be set to either 755, 775, or 777 (once you've assigned the ownership of the new directory, try the permissions in this order until you find one that works - 775 works for me).

    Hope this helps.

    Posted 8 years ago on Friday December 9, 2011 | Permalink
  7. Thank you for sharing your experience ideaboxx

    Posted 8 years ago on Saturday December 10, 2011 | Permalink

This topic has been resolved and has been closed to new replies.