Skip Navigation

[Resolved] "You can only upload an image file" and "You cannot upload a file of this type"

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 1 year, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2508083

When using Toolset post forms frontend to publish a custom post i get the error "You cannot upload a file of this type". However, the featured image upload works fine.

If i use WPForms to make the custom post submission, it works fine both with featured image and file upload.
But when i then try to edit the post frontend afterwards, using Toolset post form edit, the errors still occur.

I tried disabling Really Simple SSL, disabling Wordfence and changing theme. Still same problem. There are no .htaccess Prevent PHP Execution in the uploads folder.

Regards

#2509451

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Are you getting this error while trying to upload any file or is it happening only for files of any particular extension or size?

Please also see if any other error or warning is generated in the server's error log when the form submission fails.
( you can temporarily enable WordPress debugging before this test: https://wordpress.org/support/article/debugging-in-wordpress/ )

Lastly, also see if the website includes any custom code that limits the use of any particular file type or size, for the Toolset Forms.

I hope this helps and let me know how it goes.

regards,
Waqar

#2509551

Images work in the post form for both the featured image, and also the file upload.
No other files than image files work in the file upload.

When the post is published and i want to edit the post frontend afterwards, it is not possible to use the edit form and submit the edit form unless i upload a new featured image even though the image preview works fine and the image is uploaded. I then have to reupload a featured image even though there already is an featured image. But still, the file upload for documents also doesn't work in the edit post form - Error: "You cannot upload a file of this type".
If i try submitting the edit post form frontend with the already uploaded image, it says: "You can only upload an image file"

Debugging is enabled and it generates alot of errors when trying to submit post form or submitting edit post form.

#2511675

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

I've performed some tests on my website, but couldn't reproduce this behavior. It looks like something specific to your website or server is involved.

To troubleshoot this, I'll need to see exactly how this form is set up in the admin area. Can you please share the temporary admin login details, along with the link to the page where this edit form can be seen? I'll also need your permission to download the clone/snapshot of the website, in case it needs to be investigated on a different server.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2518051

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting.

During troubleshooting, I noticed that a form named "Jobsi.dk jobagent" from WPforms has been included in the popup.

If that form's shortcode is removed from that popup, the file upload field in the Toolset Form starts working correctly.

To avoid this conflict, you can replace that form in the popup with a Toolset Form too.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.