pqina / filepond

🌊 A flexible and fun JavaScript file upload library
https://pqina.nl/filepond
MIT License
15.16k stars 825 forks source link

Drag and re-order files before upload #146

Closed leoliu closed 4 years ago

leoliu commented 6 years ago

I have received a report from a user that a feature disappeared recently. Previously it was possible to drag and re-corder files before uploading them. Now it is not possible any more. Is this intentional?

I have checked the documentation and commit log but could not find anything related to this change.

rikschennink commented 6 years ago

The production version of FilePond has never had the option to drag files. You can however drop them at a location that you want.

clementmas commented 5 years ago

Well that'd be a great plugin to have :) Is this something you're considering on your roadmap?

Meanwhile, is there any way to reverse the default order (i.e. insert new files at the bottom of the list)?

rikschennink commented 5 years ago

An earlier version of FilePond had it but I removed it to get to 1.0 quicker, will probably add it in the future somewhere if demand grows.

kelong commented 5 years ago

I also need reverse order and it's critical for me. Trying to hack it somehow right now with no luck :(

rikschennink commented 5 years ago

@kelong I'm currently working on a grid view, which also required rewriting the way files are dropped, I might add sorting to the mix as well.

kelong commented 5 years ago

@rikschennink Great thanks. That would change a lot. How long do you think it would take to do that?

rikschennink commented 5 years ago

@kelong Can't give time estimate as this is work that is done in between other work

rikschennink commented 5 years ago

@kelong @clementmas No drag and drop yet but I've added file sorting in version 4.0.0

smickar commented 5 years ago

Hi, when you finish drag and drop file sorting, could you also change hidden input field "filepond" with file ID to an array (<input type="hidden" name="filepond[]" value), or to filepond1 .... filepond100000 :). So it will be easy to write sorting to db on server (now I receive only one variable filepond) Thank you.

rikschennink commented 5 years ago

@smickar are the files not sorted correctly?

smickar commented 5 years ago

Hi, it is not about sorting, but about that every file hase same hidden input name "filepond". So when I submit form with Filepond I receive only one variable "filepond", even if I have xx files.

rikschennink commented 5 years ago

@smickar, that's basically how it works at the moment, this is how the PHP boilerplate functions: https://github.com/pqina/filepond-boilerplate-php

violabg commented 5 years ago

Hope to see manual sorting soon

p-young commented 5 years ago

Also hoping to see this feature implemented!

alperbicer commented 5 years ago

hi @rikschennink, is there any development about drag and drop sorting?

rikschennink commented 5 years ago

I've developed a tiny prototype but so far haven't had time to work on it further.

Eric24 commented 5 years ago

Definitely a much-needed feature. Maybe it goes without saying, but it should also be possible to resort existing files, not just newly-uploaded ones.

KilledDebtor commented 5 years ago

I did not find any uploader with manual sorting :(

andonimihai commented 5 years ago

@KilledDebtor I think this one is a good example: https://innostudio.de/fileuploader/examples/sorter/default/

yqlim commented 4 years ago

I have written a simple plugin for this: https://github.com/yqlim/filepond-plugin-drag-reorder

It has been tested for ajax submission. It has not been tested with FilePond upload feature however.

caroliina commented 4 years ago

Is the prototype code available somewhere? I am also super interested in this feature. I agree with a previous comment that it should apply to existing files (I want to implement a way to manually sort existing + new images and save them with their sequence information). @yqlim solution might do the trick though, I need to test it out. Thank you!

rikschennink commented 4 years ago

👉 https://twitter.com/rikschennink/status/1205139448360509442?s=20

jwsinner commented 4 years ago

Looking good. Can't wait for the update. I've hacked together a rough drag and drop reordering so it'll be nice to have something cleaner to work with.

rikschennink commented 4 years ago

First reorder by drag/drop has been added in 4.9.1.

EmmanuelJego commented 4 years ago

@rikschennink You made my day ! Really nice, thanks for your work !

nusoft commented 4 years ago

@rikschennink Thanks a lot for this update! Is there (or will there be) a Callback for listening to reordering events? Or is there another way to get the order of the files when it changes?

rikschennink commented 4 years ago

@nusoft That sounds like a good idea. It currently does not trigger any events.

OneMajed commented 4 years ago

@rikschennink I enabled allowReorder but it didn't work with me.. I just want to get the order of elements once I submit the form. How would I do that?

rikschennink commented 4 years ago

Hi @OneMajed I don't understand how this is related to re-order, can you elaborate

OneMajed commented 4 years ago

Currently, I am sending the images using ajax. What I need to achieve is once I submit the form with the images, I need the images order to be sent to my backend with the same order displayed. How can I receive this ordered list (for example as a json)

Thanks @rikschennink

rikschennink commented 4 years ago

@OneMajed getFiles should return the correct order.

OneMajed commented 4 years ago

Thanks @rikschennink it worked with me

prince272 commented 4 years ago

Any plans to support grid reorder. Only works in column mode.

rikschennink commented 4 years ago

@prince272 https://github.com/pqina/filepond/pull/421

rikschennink commented 4 years ago

Now available in 4.15.0