Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropzone: handle multiple files #7

Open
jmsche opened this issue Dec 4, 2020 · 30 comments
Open

Dropzone: handle multiple files #7

jmsche opened this issue Dec 4, 2020 · 30 comments

Comments

@jmsche
Copy link
Contributor

jmsche commented Dec 4, 2020

It would be nice if Dropzone could handle multiple files.

I was expecting it would as its parent type is the FileType, that allows setting multiple option to true.

@tgalopin
Copy link
Member

tgalopin commented Dec 4, 2020

Yep, that's a good idea! I'm not sure how to handle it properly yet but that's a good idea :)

@AxelBriche
Copy link

Probably like https://www.dropzonejs.com, with multiple query in ajax for upload each image and return a valid or error response.

dunglas added a commit to dunglas/ux that referenced this issue Mar 2, 2021
dunglas added a commit to dunglas/ux that referenced this issue Mar 2, 2021
* /Users/dunglas/workspace/hotwire-bundle:
  prepare merge in symfony/ux
  tweaking how the cloned form is used in the docs (symfony#12)
  updating stream media type to match changes in Turbo (symfony#11)
  ci: setup GitHub Actions (symfony#8)
  fix: regressions introduced in #5 (symfony#7)
  Relax minimum php version (#5)
  fix: various quality improvements (symfony#6)
  test: add UI tests (#4)
  ci: add PHPStan
  ci: add PHP-CS-Fixer
  refactor: broadcast template conventions and config
  refactor: decouple Broadcast from Twig and Mercure
  feat: initial implementation
@Lenawel
Copy link

Lenawel commented May 7, 2021

is Multiple Files allowed or not yet ?

@connorhu
Copy link

connorhu commented May 8, 2021

I plan to make multiple and chunked file uploads in one of my pilot project. At this moment I don't find any "official" direction about templating of UX modules (small prototypes). This is problem at my symfony collection type ux module too.

@yassinehamouten
Copy link

Hello,
I am having the same issue. I did a few things to make it work.
I will try to make it available to everyone as a package

@expace-dev
Copy link

Hello,

someone have the solution to do multiple upload?

@yassinehamouten
Copy link

yassinehamouten commented Nov 13, 2021

Hello,

You can see how I make it work there https://github.com/yassinehamouten/ux-dropzone-multiple/tree/main/Resources. I tried to do it as a package, but stimulus does not call my controller. If someone has an idea...

I changed:

You can change the symfony ux-dropzone package and build your js. It will work on production

@yassinehamouten
Copy link

yassinehamouten commented Nov 13, 2021

It's look like this if you take the css too
image

@JML75
Copy link

JML75 commented Dec 15, 2021

thank fou for your work, does it work if you use the DropzoneType:: class in your formType ?

@tgalopin
Copy link
Member

@yassinehamouten this is interesting, I wasn't sure we could do it with the multiple attribute, good news! That would be a great PR if you wish :) !

kbond referenced this issue in kbond/ux Oct 17, 2022
Adding deterministic data-live-id attribute to child components
@daFish
Copy link
Contributor

daFish commented Oct 24, 2022

@yassinehamouten Would it be ok for you when I create a PR with your changes?

@JML75
Copy link

JML75 commented Oct 25, 2022 via email

@CodingBDX
Copy link

i'm interesting, i try it but solution not work... what's the package to install dropzone-multiple? or just replace dropzone ux??

@weaverryan
Copy link
Member

I think @yassinehamouten basically forked symfony/ux-dropzone and made some tweaks to make it work with multiple - #7 (comment) - if it's that simple, it would be great if someone made a PR here to add that support :)

@CodingBDX
Copy link

CodingBDX commented Jan 25, 2023

i try to use, this https://github.com/daFish/ux/tree/feat/dropzone-support-multiple-files/src/Dropzone/Resources

but it's not work at all...same result, just one picture
@yassinehamouten i try it but it's old code for old version...

@daFish
Copy link
Contributor

daFish commented Jan 26, 2023

@CodingBDX I have not yet finished the port in the linked PR. But I just rebased my branch and it is now up-to-date.

@nzurita
Copy link

nzurita commented Jan 31, 2023

@CodingBDX I have not yet finished the port in the linked PR. But I just rebased my branch and it is now up-to-date.

Does this mean multiple file upload will be available soon?

@daFish
Copy link
Contributor

daFish commented Jan 31, 2023

@CodingBDX I have not yet finished the port in the linked PR. But I just rebased my branch and it is now up-to-date.

Does this mean multiple file upload will be available soon?

I could certainly need some help with finishing it.

@igi-1w3r53n
Copy link

Is there an update on this topic? It seems not to work out of the box with the current version (2.7.1).

@kristjan-kure
Copy link

kristjan-kure commented Apr 9, 2023

Hi! We need multiple file upload. Who can help with this? I understand daFish has been developing it, but we need it live? Who on the Symfony development team can help us to work with this?

@janklan
Copy link
Contributor

janklan commented Apr 9, 2023

Hi! We need multiple file upload. Who can help with this? I understand daFish has been developing it, but we need it live? Who on the Symfony development team can help us to work with this?

Welcome to open source. What's your budget to speed things up? I'm sure @daFish and others would find time to work on work-related things more readily than passion hobbies :-)

@igi-1w3r53n
Copy link

I had a lot of trouble with this solution. I switched to uppy (https://uppy.io/) and it works good with symfony.

@daFish
Copy link
Contributor

daFish commented Apr 11, 2023

@janklan After some thoughts I'm not going to finish this. It is based upon the work of @yassinehamouten and I'd rather propose to go with uppy.io - which is already mentioned by @igi-1w3r53n.

@janklan
Copy link
Contributor

janklan commented Apr 11, 2023

@janklan After some thoughts I'm not going to finish this.

Fair enough mate, I've been using Dropzone.js directly myself ever since I found this limitation - pretty much the same day I found this component.

For everyone else: all you need to receive multiple files is making sure your JS dropzone component (whichever it is) uploads files individually behind the scene, and then something along this trivial piece:

if (0 === $request->files->count()) {
    throw new BadRequestException('At least one file is required.');
}

if ($request->files->count() > 1) {
    throw new BadRequestException('Uploading multiple files at once is not supported.');
}

$uploadedFile = $request->files->get('file');

I'm honestly not convinced there is a need for an UX component and a dedicated form field for this. What does it actually simplify?

@cmartin6
Copy link

Is there an update on this topic? I need an option to allow multiple file-uploads using this dropzone-component...

@kristjan-kure
Copy link

kristjan-kure commented Jun 13, 2023

I don't understand the priorities. They should be:

etc.

@janklan
Copy link
Contributor

janklan commented Jun 13, 2023

I don't understand the priorities. They should be:

I find myself saying this more often than I like: welcome to open source. Feel free to contribute a solution to a real-world problem you're experiencing.

It's not easy, which is the reason why there are more takers than givers. If it helps you do your job and make a living, don't give advice how things should be, and give your time and skills instead :)

@kristjan-kure
Copy link

I don't understand the priorities. They should be:

I find myself saying this more often than I like: welcome to open source. Feel free to contribute a solution to a real-world problem you're experiencing.

It's not easy, which is the reason why there are more takers than givers. If it helps you do your job and make a living, don't give advice how things should be, and give your time and skills instead :)

Sorry, I am not a back-end developer, so I can't help build it, and I am not here to criticize. However, I can suggest a direction and discuss the need from my personal perspective.

With my experience of 20 years in web development, I believe the UX project requires a significant change in direction. One possible approach is to engage the community by allowing them to vote for UI elements. Those who have the time and expertise can contribute to building it. Votes will define the priorities. I do understand that you will need to figure out the message to send and motivate voters.

Here's an example: https://community.talk.hyvor.com/. This platform utilizes https://www.featurebase.app/ for feature voting.

@kristjan-kure
Copy link

kristjan-kure commented Jun 14, 2023

The end goal here is to establish Symfony as a prominent PHP web application framework in the market?

@ytilotti
Copy link

@daFish had done most of the work. The problem is only on the preview because ux-dropzone manage already multiple files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.