Title: Saving Attachments
Last modified: July 13, 2017

---

# Saving Attachments

 *  Resolved [Paul](https://wordpress.org/support/users/pdwiens/)
 * (@pdwiens)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/saving-attachments/)
 * I am using the “Save file to alternate location” code, from here:
    [https://cfdbplugin.com/?page_id=794](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](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](https://wordpress.org/support/users/pdwiens/).

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

 *  Thread Starter [Paul](https://wordpress.org/support/users/pdwiens/)
 * (@pdwiens)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/saving-attachments/#post-9320208)
 * [@msimpson](https://wordpress.org/support/users/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](https://wordpress.org/support/users/pdwiens/)
 * (@pdwiens)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/saving-attachments/#post-9322094)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [Paul](https://wordpress.org/support/users/pdwiens/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/saving-attachments/#post-9322094)
 * Status: resolved