alexcastano

alexcastano

Multiple but sequencial file uploads with LiveView

Hello! I’m creating a page to upload multiple files. I want that the user can select (or drag&drop) multiple files at once and start uploading. I achieved it using:

     allow_upload(socket, :samples,
       accept: :any,
       max_entries: 10_000_000,
       max_file_size: 10_000_000_000,
       auto_upload: true
     )

However, if you select 100 files all of them are uploaded at the same time. I don’t like this behavior; I’d like to upload only one file concurrently (or maybe 2). Once the file is completely uploaded, continue with the next one.

I couldn’t find any information on LiveView and this behavior. As far as I could understand, it seems to be a Javascript thing, but no idea how to modify the default behavior in LiveView.

Any ideas? Thank you!!

Most Liked

mcrumm

mcrumm

Phoenix Core Team

Not supported at the moment, but there was a previous effort to add a max_concurrency option– personally I’d be happy to review a PR if someone wanted to resurrect that effort :slight_smile:

Last Post!

sergioluka

sergioluka

Do you think the above-mentioned PR could be reopened again?
Or is there a new preferred way of achieving this?

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement