Closed Bug 1511839 Opened 2 years ago Closed 1 year ago

HTML upload from Camera yields 0-length file on Moto phones


(Firefox for Android :: General, defect, P1)




Firefox 69
Tracking Status
firefox64 --- wontfix
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- verified
firefox69 --- fixed


(Reporter: tim, Assigned: petru)




(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

Using a Moto G5 Plus (Nougat), G6 Plus (Oreo) (or likely other recent Moto phones) go to and click the browse button. Select the Camera as the source. Take any picture and hit Upload. You will see that the uploaded file is 0-bytes long. This is reproducible across different sites and implementations. It only happens from Camera sources, and as far as I know, only on Moto phones. However, these same sites work using a Camera source on Chrome or Opera. The sites also work under Firefox with the Camera on a Samsung Galaxy 7 (Nougat) or LG G4 (Marshmallow). So this seems very specific to using Camera sources on Moto phones under Firefox, and not dependent on Android version.

Actual results:

HTML forms with input type="file" upload/POST 0-byte files on submit when using a Camera source on (at least some) Moto phones. Using the Gallery or other file sources for the upload works as expected. The file name, and MIME type are correctly uploaded. Based on the speed of the page response it appears the file data is never being uploaded from the phone when the server reports 0 length files.

Expected results:

The image content from the camera capture should have been uploaded to the server.
Moto G4 Play (Android 6.0.1), too.
Ever confirmed: true
OS: Unspecified → Android
Hardware: Unspecified → All
Version: Firefox 63 → unspecified
Attached image screenshot.png
Device: Motorola Nexus 6 (Android 7.1.1)
Build: Nightly 65.0a1 (2018-12-04), Release 63.0.2, Beta 64.0b15

I was not able to reproduce the issue, the page displayed the picture`s size.
Unfortunately, we do not have another Motorola device available.
The Nexus 6 is 2 years older than the Play G4 (earliest model confirmed to have the issue). Also, as a Nexus phone it would be running pure Android rather than the Moto Camera 2 app. Either of which may well be essential to replicating the issue. If there's any further info I can provide or tests I can run that would help, I'd be happy to.

I am able to reproduce this on an LG G7 ThinQ with Android 8.0.0 on Firefox for Android 64.0.2. If I use the camera as the source then the file input is never updated and the change event never fired. If I select an existing file from disk then the file input behaves correctly.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=0" />
<script src=""></script>
$(function() {
$('#photoInput').on('change', function() {
var message = new Date().toLocaleTimeString();
<input id="photoInput" type="file" />
<h1 id="output"></h1>

Tim, great bug report, thank you. Can you check if this is still happening with Nightly 66? It is too late to fix this in 64 but we could try for 66.

Mirabela, do you have an LG phone to try this on?

Flags: needinfo?(tim)
Flags: needinfo?(mirabela.lobontiu)

The bug still exists on Nightly 66.0a1 on the Moto G6 Plus (Oreo). FYI, this bug is not seen on an LG G4 (Lollipop), so it's not all LG phones.

Flags: needinfo?(tim)

Hi Liz,

I have tested on an LG G4 (Android 5.1) on the latest Nightly 66.0a1 (2019-01-15), but I was not able to reproduce the issue.
We do not have another LG phone, unfortunately.

Thank you!

Flags: needinfo?(mirabela.lobontiu)

Hello everyone,

This issue seems to also exist on Huawei Mate 10 (running Android 8.0.0) but not on Samsung Galaxy S8 (running 8.0.0). I have also noticed, that when ever the uploaded file comes directly from camera, it raises "NS_ERROR_FILE_TARGET_DOES_NOT_EXIST" in the remote debugger when the input file is broken. Both versions, the stable 65.0 and 67.0a1 Nightly won't work on the Huawei device.

Also I might add that it is not only images that are causing issues, but videos also uploaded directly from Camera apps to <input type="file" accept="video/*">. In our case, there are no issues in firing the change event, but the uploaded file being 0-length.

See Also: → 1544267
See Also: → 1548770
Assignee: nobody → petru.lingurar
Duplicate of this bug: 1544267
Keywords: checkin-needed

Pushed by
Return the generated file if the camera result has "inline-data" action; r=VladBaicu

Keywords: checkin-needed
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69

Comment on attachment 9067015 [details]
Bug 1511839 - Return the generated file if the camera result has "inline-data" action; r?VladBaicu

Beta/Release Uplift Approval Request

  • User impact if declined: On some devices camera upload is not possible.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: On a previously affected Motorola device:
  • access
  • press Browse
  • select Camera
  • take photo and press done
  • confirm that the image name has appeared in the webpage and after pressing Upload you see the right size of the just uploaded file.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Not risky because of the minor code change. Added another way of providing the image from the Camera for a specific edgecase. Everything else should work as before.
  • String changes made/needed:
Attachment #9067015 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9067015 [details]
Bug 1511839 - Return the generated file if the camera result has "inline-data" action; r?VladBaicu

fennec camera upload fix, approved for 68.0b5

Attachment #9067015 - Flags: approval-mozilla-beta? → approval-mozilla-beta+


I tested the issue with 2 devices - device 1: Samsung Galaxy S9 with Android (8.0.0) and builds: Firefox Nightly 68.0a1(2019-05-28) and Firefox Beta 68.0b5; device 2: Motorola Moto G4 with Android(6.0.1) and builds Firefox Nightly 68.0a1(2019-05-28) and Firefox Beta 68.0b5.

I will mark this ticket as resolved-verified as the issue does not reproduce.



Due to comment 16, I'll remove the qe-verify flag, thanks.

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.