Crocoblock / jetformbuilder

75 stars 16 forks source link

I can't upload a jpg or png image using input media #478

Open pcarantes opened 3 days ago

pcarantes commented 3 days ago

Hello, my form has two fields for uploading files, one being a PDF and the other a PNG or JPG. After making all the settings, the form works correctly to upload a pdf file. However, the form presents a validation error when I configure the field to collect the user's image.

This is the error that appears in Form records: Exception: Jet_Form_Builder\Request\Exceptions\Sanitize_Value_Exception Message: has_errors Error Place: plugins/jetformbuilder/modules/block-parsers/module.php:134 Data: [ { "cartaz_do_evento": [ "upload_mime_types", "empty_field" ] } ]

This is the link to my form: https://contep.genuinne.com.br/cadastro-de-prova/

For the two input fields: PDF and Image png or jpg, it is configured in: User access - Any Users I used ACF to configure both fields.

Can you help me with this?

Crocoblock commented 1 day ago

Hi @pcarantes

Do you check the MIME types for the media field https://i.imgur.com/4UM0oDq.png?

pcarantes commented 1 day ago

Yes, I selected an option. And the error persists.

In subimitions action, I have configured: Edit Insert/Update Post And the field is mapped to save the image in I map this field to save in Post Thumbnail. When I choose to save in a Gallery type field, the error does not appear, the file is saved in /uploads/jet-form-builder but is not loaded in the custom post registration. As for the field that receives the PDF, everything runs normally.

Another condition I tested was: In subimitions action, I have configured: Send Email, and I configured the two file fields to add to the form with attachment. And if the png or jpg image field is mapped to be added to a gallery-type field, the two files are correctly attached to the recipient's message.

I believe this is a bug, when the access condition is: Any user (incl. Gest)

pcarantes commented 13 hours ago

Hello, I just did a new test where I kept all the settings mentioned in previous messages, and with a logged in user. Submit the registration of a new record. And the image was saved correctly as the custom post's featured image.

I believe there is a bug where it is not allowed to record png, jpg images as the post's featured image when I use the feature to submit a new post on the Wordpress frontend. Even if the access condition is: Any user (including Gest)