Closed Bug 1355389 Opened 3 years ago Closed 25 days ago

Unable to select multiple files for HTML Input element

Categories

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

All
Android
defect

Tracking

()

RESOLVED WONTFIX
Firefox 61
Tracking Status
fennec ? ---
firefox61 --- fixed

People

(Reporter: andrew, Assigned: andrei.a.lazar)

References

Details

(Whiteboard: [Leanplum])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170323105023

Steps to reproduce:

1. Open any webpage containing a HTML input element with type set to file and the multiple attribute set:
https://jsfiddle.net/8e5ueap4/

2. Click on the input element

3. Select the 'Documents' option

4. Long press (hold) an item to attempt to enable multiple file selection


Actual results:

Long pressing the item does nothing, and only one file is allowed to be selected.


Expected results:

Long pressing an item should select it and enable selection mode. As with what happens when using the stock browser on Android.
Thanks for reporting this!

I was able to reproduce this with Samsung Galaxy Note 4 (Android 5.0.1) and Asus ZenPad 8(Android 6.0.1) on all branches. Change the status to new and set the flags accordingly.
Note: not reproducible on Chrome.
Status: UNCONFIRMED → NEW
Ever confirmed: true
firefox for android `<input type="file" multiple>` not work

sony xpreia x5c
android 7.1.1
I'm also having the same problem.

We have a site where the users can send many photos for printing.

The users are trying to send many pictures, and can't do it using FF.
Our support team has to always say to use Chrome, and it's very embarrassing.

Any hopes that this bug will be fixed?
(In reply to eduardo.gaedke from comment #3)
> I'm also having the same problem.
> 
> We have a site where the users can send many photos for printing.
> 
> The users are trying to send many pictures, and can't do it using FF.
> Our support team has to always say to use Chrome, and it's very embarrassing.
> 
> Any hopes that this bug will be fixed?

please arrange!
Can this get fixed? It's a big pain point to not be able to select multiple files at once.
Flags: needinfo?(michael.l.comella)
tracking-fennec: --- → ?
OS: Unspecified → Android
Hardware: Unspecified → All
Version: 52 Branch → Trunk
Duplicate of this bug: 1439228
[triage] If this is used often, it's critical. However, I'm not sure how often it's used. I think the picture use case above (comment 2) is the major one I can think of.
Flags: needinfo?(michael.l.comella) → needinfo?(sdaswani)
Priority: -- → P1
Also putting on Softvision's list.
Flags: needinfo?(sdaswani)
Whiteboard: [Leanplum]
One use case for me is, wanting to upload a batch of photos to Google Photos via the web interface. This is currently barely possible since I have to select them one by one instead of choosing all at once.
Assignee: nobody → vlad.baicu
Assignee: vlad.baicu → andrei.a.lazar
The extra parameter to the event message which contains a value that indicates if the input element supports multiple files. Also, in android's FilePicker this value is then checked and handled by marking the Intent with a specific flag which indicates if the user should be allowed to pick multiple files. My thoughts are that the accepted file format doesn't exclude the multiple choice.
Attachment #8967762 - Flags: review?(sdaswani) → review?(michael.l.comella)
Comment on attachment 8967762 [details]
Bug 1355389 - Added one extra parameter to the message from the emitted event, parameter which indicates if the input element has multiple attribute.

https://reviewboard.mozilla.org/r/236468/#review243172

This lgtm: I verified that the multiple selection UI works and is disabled when `multiple` is not present. However, I did not verify that the server will actually receive multiple uploads because setting up a test case will take a little while for me off-hand.

Andrei, did you have a chance to test that? To save time if everything is working as expected, I'll land this as is. If the server is unable to receive multiple files, please file a follow up.

::: commit-message-8a94f:1
(Diff revision 1)
> +Bug 1355389 - Added one extra parameter to the message from the emitted event, parameter which indicates if the input element has multiple attribute. r?sdaswani

nit: This commit message should be more high-level and specific, e.g.: `Bug 1355389: Enable multi-selection for file uplodas.`

It's not worth blocking push over though.

::: mobile/android/base/java/org/mozilla/gecko/FilePicker.java:198
(Diff revision 1)
>                  addActivities(intent, intents, baseIntents);
>              }
>          } else {
>              baseIntent = getIntent("*/*");
> +            if (isModeOpenMultiple) {
> +                baseIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);

nit: I don't love the code duplication but given how this method is written, it's probably easier to do it this way.
Attachment #8967762 - Flags: review?(michael.l.comella) → review+
Flags: needinfo?(andrei.a.lazar)
Pushed by michael.l.comella@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/376bf7bbb828
Added one extra parameter to the message from the emitted event, parameter which indicates if the input element has multiple attribute. r=mcomella
https://hg.mozilla.org/mozilla-central/rev/376bf7bbb828
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Tested and I can confirm it works as expected.
Flags: needinfo?(andrei.a.lazar)
read file prop throw error.

reproduce: 
1. open https://xianqiao.wang/test/firefox-file-upload/ in firefox for andorid
2. click upload
3. choose multiple file
This does not yet work properly. When more than one file is selected, an exception is thrown. Follow the steps in Comment 16 to reproduce.
Flags: needinfo?(andrei.a.lazar)
Hello Jovan, the work for this ticket is done. The user was not able to select multiple files even when the HTML element (input) contained the multiple attribute. However, this is only a partial fix, because for now, even though you can select multiple files, only the first one is going to be uploaded. The rest of this fix will be found here (https://bugzilla.mozilla.org/show_bug.cgi?id=1456557) as soon as possible. Thank you!
Flags: needinfo?(andrei.a.lazar)
Hello! Selecting multiple files works properly now; however this bug will be signed as verified after https://bugzilla.mozilla.org/show_bug.cgi?id=1456557 will be fixed as well, since both are part of the same action/behavior.
Flags: needinfo?(igor.lazar)
Keywords: checkin-needed

Hello!

Fixed the problem, not being able to upload multiple files.

The patch against Fennec 71.0a1 requires changes in:

  • FilePicker.js
  • FilePicker.java
  • FilePickerResultHandler.java

Is there anyone here who is able to guide me through the patch submission process?
Or better: to check, correct and submit the patch?

Please forgive me: I have no idea how to contribute properly.

Hello PeterS and thank you for your interest.

You can follow this link in order to setup your environment and be able to publish your patch.

If you manage to publish it to phabricator, you can ask me as a reviewer (AndreiLazar is my tag).
If you have a hard time following the steps from the link, you can contact me on slack (@alazar).

I hope this was useful.

Attachment #9094597 - Attachment description: Bug #: 1355389 → Bug 1355389 - Filepicker can now handle multiple files r=AndreiLazar
Keywords: checkin-needed

Hello PeterS,

you need to post a build from treeherder which is going to be validated by QA team (see example here and documentation for setting up your treeherder environment) and ESR uplift request (see example here) for this patch in order for your changes to be contained in the next release.

Thank you again for contribution.

Flags: needinfo?(igor.lazar)

Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f04641fbd147
Filepicker can now handle multiple files r=AndreiLazar

Keywords: checkin-needed

Backed out changeset f04641fbd147 (Bug 1355389) for linting at /builds/worker/checkouts/gecko/mobile/android/components/FilePicker.js.

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=f04641fbd14787d57547375aebbfea16abe64f8b

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=268387714&repo=autoland&lineNumber=300

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=601d0c8dceac0752e352a746572e4ce88a0abf6f

[vcs 2019-09-25T16:19:33.390Z] 283282 files updated, 0 files merged, 0 files removed, 0 files unresolved
[vcs 2019-09-25T16:19:33.604Z] updated to f04641fbd14787d57547375aebbfea16abe64f8b
[vcs 2019-09-25T16:19:33.609Z] PERFHERDER_DATA: {"framework": {"name": "vcs"}, "suites": [{"extraOptions": ["m3.xlarge"], "lowerIsBetter": true, "name": "clone", "serverUrl": "us-west-1.hgmointernal.net", "shouldAlert": false, "subtests": [], "value": 166.16022396087646}, {"extraOptions": ["m3.xlarge"], "lowerIsBetter": true, "name": "update", "serverUrl": "us-west-1.hgmointernal.net", "shouldAlert": false, "subtests": [], "value": 110.38971590995789}, {"extraOptions": ["m3.xlarge"], "lowerIsBetter": true, "name": "overall", "serverUrl": "us-west-1.hgmointernal.net", "shouldAlert": false, "subtests": [], "value": 276.7523009777069}, {"extraOptions": ["m3.xlarge"], "lowerIsBetter": true, "name": "overall_clone", "serverUrl": "us-west-1.hgmointernal.net", "shouldAlert": false, "subtests": [], "value": 276.7523009777069}, {"extraOptions": ["m3.xlarge"], "lowerIsBetter": true, "name": "overall_clone_fullcheckout", "serverUrl": "us-west-1.hgmointernal.net", "shouldAlert": false, "subtests": [], "value": 276.7523009777069}]}
[vcs 2019-09-25T16:19:33.904Z] TinderboxPrint:<a href=https://us-west-1.hgmointernal.net/integration/autoland/rev/f04641fbd14787d57547375aebbfea16abe64f8b title='Built from autoland revision f04641fbd14787d57547375aebbfea16abe64f8b'>f04641fbd14787d57547375aebbfea16abe64f8b</a>
[setup 2019-09-25T16:19:33.904Z] GECKO_PATH is /builds/worker/checkouts/gecko
[task 2019-09-25T16:19:33.905Z] executing ['bash', '-cx', './mach lint -l file-perm -f treeherder -f json:/builds/worker/mozlint.json']in /builds/worker/checkouts/gecko
[task 2019-09-25T16:19:33.908Z] + ./mach lint -l file-perm -f treeherder -f json:/builds/worker/mozlint.json
[task 2019-09-25T16:19:34.911Z] New python executable in /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python2.7
[task 2019-09-25T16:19:34.911Z] Also creating executable in /builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python
[task 2019-09-25T16:19:36.646Z] Installing setuptools, pip, wheel...done.
[task 2019-09-25T16:19:37.761Z] running build_ext
[task 2019-09-25T16:19:37.761Z] building 'psutil._psutil_linux' extension
[task 2019-09-25T16:19:37.761Z] creating build
[task 2019-09-25T16:19:37.761Z] creating build/temp.linux-x86_64-2.7
[task 2019-09-25T16:19:37.761Z] creating build/temp.linux-x86_64-2.7/psutil
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
[task 2019-09-25T16:19:37.761Z] creating build/lib.linux-x86_64-2.7
[task 2019-09-25T16:19:37.761Z] creating build/lib.linux-x86_64-2.7/psutil
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/psutil/_psutil_common.o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -o build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so
[task 2019-09-25T16:19:37.761Z] building 'psutil._psutil_posix' extension
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
[task 2019-09-25T16:19:37.761Z] x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/psutil/_psutil_common.o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o -o build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so
[task 2019-09-25T16:19:37.761Z] copying build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so -> psutil
[task 2019-09-25T16:19:37.761Z] copying build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so -> psutil
[task 2019-09-25T16:19:37.761Z] 
[task 2019-09-25T16:19:37.761Z] Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
[task 2019-09-25T16:25:51.247Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/components/FilePicker.js:0 | Execution permissions on a source file (file-perm)
[taskcluster 2019-09-25 16:25:51.955Z] === Task Finished ===
[taskcluster 2019-09-25 16:25:53.089Z] Unsuccessful task run with exit code: 1 completed in 658.85 seconds
Flags: needinfo?(andrei.a.lazar)

Hi Andrei Lazar,

thank for your guidance.

I have three problems:

1.) The file permissions in the first patch were wrong. I´ve already fixed this and submitted again. Hope this is the right way.

2.) You mentioned that I have to post a build from treeherder. What are the steps to do? (I don´t have a push-access-account as stated in the documentation link https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/auth.html).

3.) I understand the purpose of "ESR uplift request". Which steps are necessary?

Hello PeterS,

1.) The file permissions in the first patch were wrong. I´ve already fixed this and submitted again. Hope this is the right way.

Which one? The one that I posted?

2.) You mentioned that I have to post a build from treeherder. What are the steps to do? (I don´t have a push-access-account as stated in the documentation link https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/auth.html).

That's my bad, I forgot you need extra privileges in order to use treeherder.
Stefan, how would you suggest proceeding further?

3.) I understand the purpose of "ESR uplift request". Which steps are necessary?

Filling that form as in the example should be enough, but first you need to get your patch verified by the QA through a signed build (that's why I suggested using treeherder).

The thing is, Fennec is in maintenance mode (from here comes the need for ESR uplift requests) because it's going to be replaced by Fenix very soon, which means your contribution is more needed and would have more value on it (check here), and it's way much easier to contribute. Please consider this.

Flags: needinfo?(andrei.a.lazar) → needinfo?(sarentz)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

This is a new feature. We should be minimizing the amount of change that goes into Firefox for Android as part of Gecko 68. Working on this in Mozilla's Android Components would be a better place for this work, https://mozac.org/contributing/ it is used to build projects like Fenix (Firefox Preview)

I agree, but at the same time if this patch doesn't introduce any regression I feel this contribution should be welcomed. Furthermore since it's not going to be long lived because of the switch to Fenix. At a first glance the solution looks good but I don't really have much time to look into more detail, good job @PeterS.

Peter, unfortunately we have decided to not land this patch. The risk of regressions is too big. I am very sorry about this, I know you put a lot of time in this patch.

Status: REOPENED → RESOLVED
Closed: 2 years ago25 days ago
Flags: needinfo?(sarentz)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.