Title: Can&#8217;t change upload folder
Last modified: May 11, 2018

---

# Can’t change upload folder

 *  Resolved [bradkacz](https://wordpress.org/support/users/bradkacz/)
 * (@bradkacz)
 * [8 years ago](https://wordpress.org/support/topic/cant-change-upload-folder/)
 * Hi,
    i try change upload files outside media library, to directory for example‘
   form-uploads’. Checkboxes Attach to Mailer, Allow Multiple and Add to Media Library
   are off. I have functions.php in child-theme, field_id copy from actual form.
   I created directory form-uploads in /wp-content/uploads/form-uploads and set 
   chmod 777.
 * **Url added file from mail is still**
    [http://prototyp.zsto.cz/wp-content/uploads/f1f15d409e4e5e53e773a84e80673769/test-pdf-1.pdf](http://prototyp.zsto.cz/wp-content/uploads/f1f15d409e4e5e53e773a84e80673769/test-pdf-1.pdf)
   and file isn’t here.
 * **my code from functions.php:**
    add_filter( ‘caldera_forms_upload_directory’,
   function( $dir, $field_id ){ if( ‘fld_1720034’ == $field_id ){ $dir = ‘form-uploads’;}
   return $dir; }, 20, 2 );
 * /** Wait until caldera_forms_core_init hook so we know all actions were added**/
   
   add_action( ‘caldera_forms_core_init’, function() { //File delete is attempted
   first here, but if an email should send, the file isn’t deleted// remove_action(‘
   caldera_forms_submit_complete’, array( ‘Caldera_Forms_Files’, ‘cleanup’ ) );
 *  //If email is set to be used, we wait until email is sent to delete on these
   hooks:
    remove_action( ‘caldera_forms_mailer_complete’, array( ‘Caldera_Forms_Files’,‘
   delete_after_mail’ ), 10, 3 ); remove_action( ‘caldera_forms_mailer_failed’, 
   array( ‘Caldera_Forms_Files’, ‘delete_after_mail’ ), 10, 3 );
 *  //Just in case of a never completed submission or some other issue, a CRON job
   is used to delete the file
    remove_all_actions( Caldera_Forms_Files::CRON_ACTION);
 * });
 * Thank you for any help
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcant-change-upload-folder%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [christiechirinos](https://wordpress.org/support/users/christiechirinos/)
 * (@christiechirinos)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/cant-change-upload-folder/#post-10468191)
 * While we can’t help you troubleshoot or provide specific directions for custom
   code modifications, there are many resources available that can point you in 
   the right direction:
    If you’re adding CSS to your site, review our recommendations
   for where to put your code, recommended themes, tutorials, and other best practices.
   [https://calderaforms.com/doc/adding-custom-style-caldera-forms/](https://calderaforms.com/doc/adding-custom-style-caldera-forms/)
   On the documentation page for any of our hooks, for example this one, there is
   a panel at the end with the header “Where Does This Code Go?” That gives you 
   links to introductory articles about what WordPress hooks are, why you use them
   and how to use them. Caldera Forming is our customer and developer forum. As 
   a part of this community, you can ask fellow Caldera Forms users for help with
   custom code and design. [https://www.facebook.com/groups/651862761663883](https://www.facebook.com/groups/651862761663883)
   If you’re looking for comprehensive assistance in developing your site (as opposed
   to small code modifications), or if you’d rather leave the customization to the
   professionals, consider reaching out to someone from our list of recommended 
   developers: [https://calderaforms.com/recommended-developers/](https://calderaforms.com/recommended-developers/).
   Visit our developer documentation for tutorials and troubleshooting help. [https://calderaforms.com/category/developer-api/](https://calderaforms.com/category/developer-api/)
   If you’re adding code from a third-party source, we recommend reaching out to
   the source for help.

Viewing 1 replies (of 1 total)

The topic ‘Can’t change upload folder’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

## Tags

 * [upload file](https://wordpress.org/support/topic-tag/upload-file/)

 * 1 reply
 * 2 participants
 * Last reply from: [christiechirinos](https://wordpress.org/support/users/christiechirinos/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/cant-change-upload-folder/#post-10468191)
 * Status: resolved