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!