Forums

iphone / ipad file upload from camera roll results in 'uploaded file type not allowed'

Greg R. 31 Aug, 2016
This is possibly an iOS issue, but I wonder if anything can be done about it: If you have an <input type="file">, using an iphone or ipad, you can take a picture with the camera just fine, and submit the form. If you try and select an image from the device (camera roll) and input that, then submit the form, it will fail with an 'uploaded file type not allowed'.

1) is a workaround possible? I found that you had some code for Joomla to generate a filename with multiple uploads here:
https://www.chronoengine.com/faqs/53-cfv4/cfv4-file-uploads/3739-multiple-file-uploads-from-an-ipadiphone-dont-work-.html

2) would it work if we disabled file type checking? Can that be done?
Greg R. 31 Aug, 2016
For what it's worth, I just tried it with Contact Form 7, and it works: You can select an image from the camera roll on an iPhone (iOS 9.3), and it will submit the form and email an attachment with no problems. That either means that there's no inherent problem with the <input> element in iOS anymore, or CF7 did a workaround.
Greg R. 31 Aug, 2016
Answer
Ok, after wasting waaay too much time on this, here's the solution: This is what your Files Config field should look like in your Upload action: myfile1:jpg-png-gif-JPG-jpeg Note that jpg AND jpeg! Because guess what? Files that come from the Photo roll are given a jpeg extension, and files that come from the iphone camera have a jpg extension. Logic! If I was a jerk about it, I might try to give the ChronoEngine guys a hard time for not accounting for both extensions automatically, but nah!😛
GreyHead 31 Aug, 2016
1 Likes
Hi Greg R,

I have no idea why they are different - iPhone quirks maybe :-(

To answer an earlier question, you can't omit the type validation as that would leave you open to getting some nasty file types uploaded.

Bob
This topic is locked and no more replies can be posted.