[Résolu] File upload, only stores file name, no actual file
This support ticket is created Il y a 6 années et 7 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Hi i've created a CPT with a CPF for file uploads.
I've created a CRED form (autogenerate) ...
It all seems to be ok when i add a file for uploading and submit the post.
The weird thing is, that when i want to putput the file url, i only get the filename... not the full url. When editing the post from the WP dashboard, also only the filename is stored... not the actual path. The file isn't anywhere... not in the media library... not in the server wp-content/uploads.
When adding the file from the backend, it gets stored in the media library and outputs correctly including the full path.
WordPress is installed in a subfolder on a dev environment. Any idea?
Okay the first thing I would do is try to narrow down the source of the problem. Please deactivate all plugins except Types, Views and CRED. Then activate a default theme like Twenty Seventeen, and try again. If the problem is resolved, reactivate your theme and plugins one by one until the problem returns.
If the problem persists after disabling plugins, please turn on server logs in your dev environment and check to see if any server-side errors are generated during the file upload process. If you're not familiar with server logs, I can show you how to activate them. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);
Then add these lines, just before it says 'stop editing here':
Try to upload an image with CRED again. If any server-side errors are thrown, an error_log.txt file will be created in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.
If no error log is generated, then activate a child theme and add the following code to functions.php:
add_filter("cred_file_upload_disable_progress_bar", "disable_progress_bar");
function disable_progress_bar($val) {
return true;
}
This will disable the AJAX uploader and require a full form submission. Please try the CRED form once more and let me know the results.