api icon indicating copy to clipboard operation
api copied to clipboard

File upload module error detection in formtools 2

Open slimthick opened this issue 4 years ago • 0 comments

I still use form tools 2 and I noticed that sometimes file uploading fails while using the API. If I try to upload an invalid file on the back-end I get a detailed error message but via the API the form is submitted regardless without any explanation.

So, I dug around and found the function that processes file uploads, ft_file_api_process_form_hook in modules\field_type_file\library.php, and I can call error_log() on the message it generated but is there a way to have formtools not submit the form and display why the file upload failed on the form page?

slimthick avatar Aug 10 '21 17:08 slimthick