question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple files in one POST request

See original GitHub issue

The file picker option in the app doesn’t support multiple files as of now, ( correct me if I’m wrong ) … neither does it support Content-Type=multipart/form-data … I know in a simple html form u can write something as `<input … multiple=“multiple” encoding=“multipart/form-data” … say I wanted to POST a request to that endpoint containing many files…

I’d like to see some kind of support for sending multiple ( say image files ) in a POST request preferably through the same file picker

Alternative: probably, using application/json and sending files after converting them into base64 then writing more server side logic to parse the json and covert them back to images, that’s inconvenient, plus you can’t use variables here, as there is no present functionality that helps to simplify this ( an alternative javascript solution can exist, but I’d still prefer to use the file picker … also, the only language I know is python … ^^")

I’m pretty new to all of this stuff, …^^" … so I have limited knowledge, feel free to ask more stuff or suggest me better solutions, thank you very much for your time

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Waboodoocommented, Jul 16, 2022
  1. the file picker actually stored the selection order of files

As the file picker is not part of the app, but comes from Android itself or from another app, I have no control over it. The only way to achieve this reliably would be to build a custom file picker into the app, which would have its own drawbacks

  1. a separate in-app window for reordering the files

This would be feasible, but requires a lot of effort to build. I’ll keep the idea in the backlog, but will not focus on it for now. I want to make some general improvements to how files are handled in the app, so maybe it fits in with that broader topic, but currently I have no timeline for that.

1reaction
Waboodoocommented, Apr 18, 2022

Unfortunately, the order of the files is given by the file picker, which is not part of the HTTP Shortcuts app but the Android OS (or possibly some other third-party app). As such, the files are uploaded in no particular order, and the actual order may be random or decided by the picker. There isn’t an easy way to fix this, short of building a fully custom file picker into the app, but that would come with drawbacks of its own.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uploading multiple files in a single request using python ...
If you have multiple files in a python list, you can use eval() in a comprehension to loop over the files in the...
Read more >
Uploading Multiple Files In A Single "Form Post ... - Ben Nadel
Ben Nadel looks at using the native FormData class to easily upload multiple files in a single "multipart/form-data" POST using the ...
Read more >
How to upload single or multiple files the easy way with ...
Next, we define the uploadFile() method in which we first declare an API_ENDPOINT variable that holds the address of our file uploading endpoint ......
Read more >
Request Files - FastAPI
You can declare multiple File and Form parameters in a path operation, ... This is not a limitation of FastAPI, it's part of...
Read more >
Download multiple files in one http request - Motobit Software
HTTP protocol was designed to send one file per one request. Sometimes you will need to send more files - usually when a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found