Not required FILE UPLOAD is requried

Issues related to forms.
Post Reply
cmsintent
 
 
Posts: 99
Joined: Tue Oct 09, 2007 4:59 pm
Location: Alberta, Canada
Contact:

Not required FILE UPLOAD is requried

Post by cmsintent »

Good Morning Pablo

I have a form located at https://www.iwantwireless.ca/careers.php

I have a FILE UPLOAD to be sent as an attachment to the form results.

For the FILE UPLOAD > Validate ... I do not have the "Data required (the user must specify a filename)" checked - with the intent that is optional.

But ... the form will not send unless a file is attached. If no file is attached then I am sent to the error page.
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Not required FILE UPLOAD is requried

Post by Pablo »

If you add validation to the File Upload then input is required.
MGD4me
 
 
Posts: 287
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

Re: Not required FILE UPLOAD is requried

Post by MGD4me »

Just a wild (rose) guess here, since I can't see what options you have configured, but I noticed that you are enforcing the type of docs which are acceptable for upload, like "doc, docx, pdf, etc", so perhaps the form now "requires" one of these??
cmsintent
 
 
Posts: 99
Joined: Tue Oct 09, 2007 4:59 pm
Location: Alberta, Canada
Contact:

Re: Not required FILE UPLOAD is requried

Post by cmsintent »

Hi Pablo ... does MGD4me's response make since ... because I am limiting the type of file formats this creates the required status?
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Not required FILE UPLOAD is requried

Post by Pablo »

because I am limiting the type of file formats this creates the required status?
Correct
cmsintent
 
 
Posts: 99
Joined: Tue Oct 09, 2007 4:59 pm
Location: Alberta, Canada
Contact:

Re: Not required FILE UPLOAD is requried

Post by cmsintent »

Hi Pablo ... would like to revisit this topic.

Is there a way to not force the form user to add an upload file if I have set the types to for example: docx, doc, pdf, png, jpg ...etc

I really don't want an "open" upload field as I suspect this opens up .exe, batch files and possible malware extensions.

On a side note... I use Coffee Cup Web Builder form software and I can predetermine and limit types, without forcing a file to be uploaded.

My intent is have a form that IF the person wants to send an image along with his comments he can .. but again want to limit of what can file type can be sent?

Thanks ... the reason I am moving slowly over to this form structure is because I really like hCaptha.

Thoughts?
User avatar
BaconFries
 
 
Posts: 5327
Joined: Thu Aug 16, 2007 7:32 pm

Re: Not required FILE UPLOAD is requried

Post by BaconFries »

From reading Pablos reply.... this is my understanding if you add a validation then you are telling the form that the user must fill this in so it will get processed and sent. If left blank then you will get a error due to it is not filled. Solution remove the validation you have added.
Pablo wrote: Sun Jun 13, 2021 6:04 pm If you add validation to the File Upload then input is required.
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Not required FILE UPLOAD is requried

Post by Pablo »

Sorry, there is no option to make the file input not required if validation is enabled.
cmsintent
 
 
Posts: 99
Joined: Tue Oct 09, 2007 4:59 pm
Location: Alberta, Canada
Contact:

Re: Not required FILE UPLOAD is requried

Post by cmsintent »

Hi Pablo

That was my understanding also ... I just find that it limits the use of the UPLOAD file field.

My input was to maybe revisit this and see if there was a possible work-around... or even a future update to address this.

Question... Would you be concerned about someone uploading .exe files or malware files?... if I choose to leave the field available, with no extension limits so that the user may or may not need to send a file with his request ... am I opening my self to security breaches?

I specifically have a Powder Coating company that has a form for questions ... and sometime people are asking for a ball park price and want to add a picture of the part they need powder coating ... not all the time, just some of the time ... thus, the dilemma

Just my 2 cents from the peanut gallery!
User avatar
BaconFries
 
 
Posts: 5327
Joined: Thu Aug 16, 2007 7:32 pm

Re: Not required FILE UPLOAD is requried

Post by BaconFries »

What you need to note is, there is nothing to stop a malicious user changing the file extension (renaming) it from .bat or .exe to say .docx, .pdf etc etc. And not to scare you it is also possible to attach/embed malicious code to a image, this is why the uploading of images directly to the forum is disabled and a link to it asked instead.
cmsintent
 
 
Posts: 99
Joined: Tue Oct 09, 2007 4:59 pm
Location: Alberta, Canada
Contact:

Re: Not required FILE UPLOAD is requried

Post by cmsintent »

Makes sense… thank for the info
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Not required FILE UPLOAD is requried

Post by Pablo »

My input was to maybe revisit this and see if there was a possible work-around.
There is currently no workaround, but I will investigate if this can be implemented somehow.
User avatar
BaconFries
 
 
Posts: 5327
Joined: Thu Aug 16, 2007 7:32 pm

Re: Not required FILE UPLOAD is requried

Post by BaconFries »

Pablo not sure if this would work or conflict with the validation. But thought I would just share.
See reply from JΛ̊KE and Kaalis
https://forum.jquery.com/topic/disable- ... pty-values
Post Reply