Forum Moderators: not2easy

Message Too Old, No Replies

Uploading photos taken by mobile

         

csdude55

8:57 pm on Oct 14, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a constant complaint from users on mobile, but none of them have been able to actually explain their problem.

I have an iframe form on my site that allows the user to attach a photo:

<input type="hidden" name="attach">
<iframe id="iframe_attach" src="https://www.example.com/cgi-bin/upload_attachments.cgi?form_name=reply&amp;width=640&amp;bgcolor=%23FFFFFF" width="450" height="35" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>


Then in upload_attachments.cgi:

<input type="file" name="attach" size="50" style="font-family: Arial, Tahoma, Helvetica; font-size: 11px" onChange="changeBack(); this.form.submit();">


I can post the entire upload_attachments.cgi if you want, but it's fairly lengthy. The purpose of the script is to upload the image to a /cache/ directory while the user stays on the page, resample it via Perl, then show the resized photo on the page without leaving. This could probably be rebuilt in Ajax and be a little smoother, it's just one of those things I built in 2012 and haven't had a need to rebuild it (yet).

I have no problem posting a photo from my phone's gallery, but other people constantly say things like "it doesn't work" (and, naturally, that's the only explanation they'll give).

Today, someone finally gave a little more info:

I will go to do a pic and it will take me all the way back out of the website

I'm not sure what that means. I tried taking a photo from my phone, instead of uploading from the gallery... and it worked perfectly. Using a Samsung S6 Edge, I clicked the "Choose File" button, clicked "Camera", took a photo, clicked "OK", and it uploaded perfectly.

Then I tried my girlfriend's iPhone 6s (running iOS 10), and it uploaded perfectly, too. I tested her phone with both Chrome and Safari.

I asked the user what phone they're using, but it's been 24 hours and they haven't replied.

Can you guys suggest what the problem might be? I'm not opposed to rebuilding the program in Ajax instead of an iframe, but I'm concerned about going through a lot of trouble just to have the same problem.

keyplyr

9:44 pm on Oct 14, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Possibly your visitor is describing the fact that mobile does not render iframes the same as desktop on some older handsets. It will either not load at all, or load in a new screen so the user will not see the parent unless they access through the history.

I don't know a work-around. I've always just accepted the collateral damage of users that hang onto old technology. Eventually, when enough things don't work for them, they'll buy a new device.

csdude55

5:55 am on Oct 15, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This was kind of my only thought, too... old hardware that doesn't support iframes. But it seems like the last year has handed me a barrage of posts along the lines of, "this site sucks, I can't upload pics, let's go to kik / Facebook / whatever instead". So I keep thinking that the problem has to be on my end.

keyplyr

6:28 am on Oct 15, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You might try a few controlled tests. Contact the user(s) who reported the issue and ask them if they would try uploading a tracer file.

They would rename a photo specifically for testing, example: test1.jpg

Then examine your raw server log to glean pertinent information. Use a text editor to search for that filename. See if your iframe loaded, look at the file size of test1.jpg, look at the user agent string to see if any attribute may be blocking the upload process... etc.