• Resolved Paul

    (@pdwiens)


    I am using the “Save file to alternate location” code, from here:
    https://cfdbplugin.com/?page_id=794

    On the FTP, I created a folder to save the form attachments.
    Putting the following URL into a web browser will download the file:
    http://www.mysite.com/stage/wp-content/uploads/formAttachments/blah.pdf

    Knowing that, what do I change the variables $uploadDir and $urlDir to, in the following code??

    // CHANGE THIS: directory where the file will be saved permanently
    $uploadDir = '/root/htdocs/wp-content/uploads/path/to/save/dir/'; 
    
    // CHANGE THIS: URL to the above directory
    $urlDir = 'http://your-site.com/uploads/path/to/save/dir/';

    Thank you so much for you help,
    Paul

    • This topic was modified 8 years, 11 months ago by Paul.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Paul

    (@pdwiens)

    @msimpson – Any advice please??

    When I set $uploadDir like this:
    /root/stage/wp-content/uploads/formAttachments/
    The error is: [function.copy]: failed to open stream: Permission denied

    When I set $uploadDir like this:
    /stage/wp-content/uploads/formAttachments/
    The error is: [function.copy]: failed to open stream: No such file or directory

    Thank you very much!
    Paul

    Thread Starter Paul

    (@pdwiens)

    Update – Assuming: $uploadDir = /root/path_to_uploadFolder
    I was able to find the correct path for $uploadDir by replacing “root” with the “absolute hosting path”:
    /home/content/**/********/html/
    (where the “*”s are numbers identify my website / account).

    I found the “absolute hosting path” by logging in to my web server.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Saving Attachments’ is closed to new replies.