Troubled file upload

Issues related to forms.
Post Reply
hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Troubled file upload

Post by hibbew27 » Thu Feb 08, 2018 8:13 pm

Hello, I have a strange issue concerning sending a mail with attachments using the built-in php-mail processor. Sending one file is no problem but when I select more files only the last one appears on the input field and is sent with the message.
And even when only picture-files are allowed, I could select and send any type of file.
Multiple files is set and the allowed extensions are set too.

Where does it go wrong??
Help me please!

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Thu Feb 08, 2018 9:26 pm

Do you mean you are sending multiple files with the same input field?
I am not sure if that will work with emails.

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Fri Feb 09, 2018 9:49 am

I did think of that because of the option to select multiple files.
Selecting this option lets me select multiple file, deselecting it makes me select only one.
And then there is the problem of the filter; in the validation area I named bmp, jpg, png and pdf but this filter is not forwarded to the file selectionwindow. I can choose any file and it will be sent to my email address.

So, where did I go wrong?

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Fri Feb 09, 2018 10:01 am

Are you using the latest version of the software (12.4)?
Selecting this option lets me select multiple file, deselecting it makes me select only one.
Note that this is standard HTML/browser functionality so I have no control over how it works.

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Fri Feb 09, 2018 1:31 pm

I am using the latest version WWB on Windows 10 pro.
As browser I use Chrome but it has the same effect in Edge.
You can see the result (in Dutch, but it says "zoeken" instead of "Browse") on www.moriatdm.nl and selectmenu-item "contact".

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Fri Feb 09, 2018 1:49 pm

I am using the latest version WWB on Windows 10 pro.
I was referring to the version of WYSIWYG Web Builder.

I'm sorry validation only works with single files, not for multiple files.

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Fri Feb 09, 2018 2:30 pm

I am using the latest version of WWB: 12.4.0 (feb 5 2018)
Still, even when I use file uploader with one file (multiple unchecked) it is still possible to send any file so the filter is not passed through.

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Fri Feb 09, 2018 3:15 pm

As far as I can tell you still have 'multiple' selected.
Did you republish the page?

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Fri Feb 09, 2018 4:10 pm

Excuse me, I hadn't uploaded this yet.
Now the contactpage is uploaded with multiple files unchecked.

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Fri Feb 09, 2018 4:28 pm

The validation seems to work correct now.

Note that validation is basically a user input suggestion or guideline. It does stop user from submitting invalid data if they want to. Validation usually can easily be bypassed.

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Fri Feb 09, 2018 4:38 pm

I have seen the result, it works OK ut I expected the filter to be passed on to the file-explorer.
For this purpose this will be well enough.
Thank you for your time and suggestions!

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Fri Feb 09, 2018 5:43 pm

No, sorry this is not how it works. There is no option for that in HTML.

hibbew27
 
 
Posts: 7
Joined: Thu Dec 29, 2016 1:05 pm

Re: Troubled file upload

Post by hibbew27 » Sat Feb 10, 2018 11:05 am

I hoped that entering allowed extensions would populate the "accept" property of the input element like in this example:
<form method="post" enctype="multipart/form-data">
<div>
<label for="profile_pic">Choose file to upload</label>
<input type="file" id="profile_pic" name="profile_pic"
accept=".jpg, .jpeg, .png">
</div>
<div>
<button>Submit</button>
</div>
</form>

User avatar
Pablo
 
Posts: 13572
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Troubled file upload

Post by Pablo » Sat Feb 10, 2018 11:12 am

Thanks for the tip. I will try to add this in a future update.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests