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 File Path blank page

  1. Hi,
    I try to set this code in my function.php template file but it doesn't work

    <?php
    add_filter("gform_upload_path", "change_upload_path", 20, 2);
    function change_upload_path($path_info, $form_id){
       $path_info["path"] = "/new/path/";
       $path_info["url"] = "http://new_url.com/images/";
       return $path_info;
    }
    ?>

    When I set the path and the url I have a blank page on my website.
    How can I resolve this problem?
    Thank you for your support

    URL of my site: http://www.miogadget.it/upload/

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  2. One thing to check is the path has to be the full absolute path on the server. It's not a relative path, it's the full server path. So you may need to double check that the path is 100% correct and that the file permissions for the folder you are using is set to CHMOD 777 or 755 to allow uploads.

    Posted 12 years ago on Monday July 11, 2011 | Permalink
  3. I set all correctly, but I see a blank page when I go to http://www.miogadget.it/upload/
    I insert this code into function.php but don't work, I see a blank page.
    I use the default theme of WP twentyten

    Posted 12 years ago on Tuesday July 12, 2011 | Permalink
  4. Loading this URL:
    http://www.miogadget.it/upload/

    Results in this page:
    http://min.us/mddckLT

    What is your experience and what did you expect to happen? Looks like you have a Page called "Upload" at this URL and the form is embedded there. That's not the same thing as your "uploads" directory which you've called "/new/path/". Also, the last part of the path there (path) should be the same at the past part of your URL (images). It's not in your example, but I'm not sure if that's just an error from editing or if you actually have something like that in use. If you post the actual code you're using, someone may be able to help.

    Posted 12 years ago on Tuesday July 12, 2011 | Permalink
  5. I only want to know if it's possible to put the images uploaded by the form into a different folder in the root of the FTP.
    This is the actual site form http://www.miogadget.it/upload/
    All WP files are into a sub folder called upload. I need to put, for example, the images into a folder with this url http://www.miogadget.it/upload_personalizzazioni/
    The new folder is on the root of the FTP and not into the upload folder.
    This is the code that I use and generate me the blank page when I visit the upload url (http://www.miogadget.it/upload/). I insert this code into function.php file, now it's disable because I need that the form works now.

    <?php
    add_filter("gform_upload_path", "change_upload_path", 20, 2);
    function change_upload_path($path_info, $form_id){
       $path_info["path"] = "/mnt/stor7-wc1-dfw1/377918/575057/www.miogadget.it/web/content/upload_personalizzazioni/";
       $path_info["url"] = "http://www.miogadget.it/upload_personalizzazioni/";
       return $path_info;
    }
    ?>
    Posted 12 years ago on Wednesday July 13, 2011 | Permalink
  6. You need to check to make sure that the path is 100% correct and the file permissions on that folder are correct. Another thing you can do is turn WordPress debug mode on and then see if you get an actual error. There may be an error right now, you just aren't seeing it because debug mode is turned off.

    Posted 12 years ago on Wednesday July 13, 2011 | Permalink