Home › Forums › General Issues › Force an Image/File upload to a particular directory › Reply To: Force an Image/File upload to a particular directory
I suspect the error is because the fact that user id is not available and the
die statement is causing the upload error.
I would try to look into what is available in $_POST, although I don’t know exactly how you can do this because all of this is happening in an AJAX request (this is the reason your die statement is causing an error)
You could try outputting the data to the error log
ob_start(); print_r($_POST); error_log(ob_get_clean());
You might find the user ID included in $_POST that is submitted for the AJAX request.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.