Dushik71 / gwtupload

Automatically exported from code.google.com/p/gwtupload
Other
0 stars 0 forks source link

Multiple file select #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello Manuel,

This is just an enhancement suggestion.

I really like this module, and will be using it in my project. However, the
only thing is that it doesn't support selecting multiple files.

I suppose you must be aware of the 'multiple' attribute as per 
http://drupal.org/node/625958

I was wondering if you will be looking into this? and maybe do it in the
way that if the browser don't support this, it will still work as usual?

Many thanks & Kind Regards
Andy

Original issue reported on code.google.com by AndyLamY...@gmail.com on 1 Apr 2010 at 3:01

GoogleCodeExporter commented 8 years ago

Original comment by manuel.carrasco.m on 5 Apr 2010 at 7:34

GoogleCodeExporter commented 8 years ago
hey..great project :D ...is there any timeline for including the HTML5 
multi-select (dnd) input element?

Original comment by nix...@gmail.com on 14 Jun 2010 at 3:12

GoogleCodeExporter commented 8 years ago
I'd like to do it soon, but I'm a bit over-busy.
-Manolo 

Original comment by manuel.carrasco.m on 1 Jul 2010 at 11:23

GoogleCodeExporter commented 8 years ago
This would definitely be a valuable asset to the project!!!  IMHO its the only 
reasonable "leg up" that the SWF uploaders have against it.

Original comment by ShieldsJ...@gmail.com on 15 Nov 2010 at 3:00

GoogleCodeExporter commented 8 years ago
Hello. This feauture is highly desirable. Plz implement it. Pleeease :-)

Original comment by Sibe...@gmail.com on 12 Mar 2011 at 2:49

GoogleCodeExporter commented 8 years ago
Hi, gwt-upload is a great library. I'd love to use it but the only thing 
stopping us is that it does not yet support selecting multiple files. Good work 
so far and hope you'll find the time to implement it soon! 

Regards,
Pia

Original comment by piakata....@gmail.com on 18 Mar 2011 at 9:17

GoogleCodeExporter commented 8 years ago
Please include this feature....... I think this is a great library and it is 
missing this feature. 

Thank you,
Turk

Original comment by saudi...@gmail.com on 21 Mar 2011 at 4:05

GoogleCodeExporter commented 8 years ago
This feature will be available in 0.6.5.

Original comment by manuel.carrasco.m on 18 Apr 2011 at 9:02

GoogleCodeExporter commented 8 years ago
Hello,

Any news about this feature and the upcoming 0.6.5 version ?

Original comment by julien.r...@gmail.com on 29 Jun 2011 at 9:06

GoogleCodeExporter commented 8 years ago
I am really interested too .. When will be available this new feature?

Original comment by icaroica...@gmail.com on 3 Jul 2011 at 2:35

GoogleCodeExporter commented 8 years ago
Me too, can't wait for this feature to become available! :)

Original comment by tomas%ek...@gtempaccount.com on 6 Jul 2011 at 7:46

GoogleCodeExporter commented 8 years ago
really important also from my side!
Thank you!

Original comment by DoctorMi...@gmail.com on 8 Jul 2011 at 9:32

GoogleCodeExporter commented 8 years ago
once ready I am going to use it immediately in my rails application. can I help 
with rails plugin/gem (as I read it on the TO-DOs) ? 

Original comment by meier.kr...@gmail.com on 9 Jul 2011 at 4:06

GoogleCodeExporter commented 8 years ago
@meier ... yeah, having a rails backend implementation for gwtupload is 
fantastic, please contact me directly or open a specific issue to discuss about 
the implementation or to attach code.

Next feature in gwtupload will be the html5 upload, I hope it will be available 
soon

Original comment by manuel.carrasco.m on 12 Jul 2011 at 7:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hallo Manuel,
Can you please tell me when the multiple file selection will be available ? Or 
will it at least the a few weeks of months before something will be available ?
Cheers
Jaap

Original comment by j...@comensis.nl on 26 Jul 2011 at 11:52

GoogleCodeExporter commented 8 years ago
Please include this feature and what's going on with this issue, thanks.

Original comment by goudreau...@gmail.com on 7 Aug 2011 at 7:06

GoogleCodeExporter commented 8 years ago
/*
         * Loop through the sub-elements of this until the
         * upload field is found and set the multiple attribute
         * which allows HTML-5 enabled browsers to select 
         * multiple files. 
         * 
         * Tested w/ Firefox 6 and 7
         * 
         * -- Alex T
         */
        Element currentElement = this.getElement();
        Element targetElement = null;
        while (currentElement != null) {
            if (currentElement.getTagName().toLowerCase().equals("input") 
                && currentElement.getAttribute("class").equals("gwt-FileUpload")) {
                    targetElement = currentElement;
                    break;
                }
            currentElement = currentElement.getFirstChildElement();
        }
        if (targetElement != null)
            targetElement.setAttribute("multiple", "multiple");

Original comment by alex.tro...@doctorsoft.com on 21 Nov 2011 at 9:37

GoogleCodeExporter commented 8 years ago
Just decided to check the status of this one and here you go - an update 45 
minutes ago! I'll try this approach.

Original comment by to...@ekc.lt on 21 Nov 2011 at 10:24

GoogleCodeExporter commented 8 years ago
It doesn't work with IE 8 and it kind of works with Google Chrome 17.
I can upload multiple files, but GWT File upload panel for progress indicator 
only displays the last file selected, not the list of files.

Original comment by to...@ekc.lt on 21 Nov 2011 at 11:03

GoogleCodeExporter commented 8 years ago
Hello all,

I'm overworked and I can not develop this feature in brief, so I can not give 
you a accurate date about it will be implemented. 

Is there anyone who wants to collaborate with this feature or even be a project 
committer?

Hopping that someone is interested on it, I write some of my thoughts about it:

- Multiple files will be only available in html5 browsers, for the rest of 
browsers we have to use fall back to the current implementation of selecting 
one file and adding them in a queue.

-  Alex's suggestion is a hack to enable the multiple attribute in html5 
browsers, but it will not work fine in gwtupload since status widgets and 
progress bar expect just the info of one file. Although the servlet can receive 
multiple files per request it reports the progress of all the request and the 
response is for just one file, so the servlet should be mofified also. The 
status bar will consider all the files and proly we could not cancel a unique 
file until all the set files finishes.

- I think gwtupload for modern browsers should send files using htmlrequest, so 
as we could send files as streams and we will know in client side everything 
about the transfer without asking the server.

- Another feature is the ability to drag and drop files from the desktop to a 
container.

Thanks
- Manolo

Original comment by manuel.carrasco.m on 22 Nov 2011 at 3:24

GoogleCodeExporter commented 8 years ago
I am willing to collaborate on this.  I have used this one:
http://code.google.com/p/gwt-html5-uploader/

Followed a blog posting on gwtpro.com but the website is now defunct. 

Unfotunately, while it used to work on firefox, it has recently stopped working 
on it (> firefox 7) 

Both drag and drop and multi file select work great in IE, Safari and Chrome, 
but no go for firefox.   In search for a better solution, I stumbled on this 
website. 

Lessons can be learned from the source code found there.  

Ted

Original comment by Theolici...@gmail.com on 12 Dec 2011 at 9:59

GoogleCodeExporter commented 8 years ago
Ted, did you get any response from Manolo on collaborating?

Original comment by to...@ekc.lt on 8 Jan 2012 at 1:17

GoogleCodeExporter commented 8 years ago
First of all, sorry by the delay, 

Please theolicious, send me a private message so as we can plan next steps.

Thanks
- Manolo

Original comment by manuel.carrasco.m on 9 Jan 2012 at 5:48

GoogleCodeExporter commented 8 years ago
Any updates?

Original comment by vere...@gmail.com on 3 Mar 2012 at 12:00

GoogleCodeExporter commented 8 years ago
Yes, guys, let's try to get this moving. There's few people wiling to 
contribute...

Original comment by to...@ekc.lt on 3 Mar 2012 at 12:07

GoogleCodeExporter commented 8 years ago
Hi all, I did not receive any response for people who willing to collaborate, 
anyone following this issue is interested on contributing?

- Manolo

Original comment by manuel.carrasco.m on 3 Mar 2012 at 7:21

GoogleCodeExporter commented 8 years ago
Element currentElement = this.getElement();
        Element targetElement = null;
        while (currentElement != null) {
            if (currentElement.getTagName().toLowerCase().equals("input") 
                && currentElement.getAttribute("class").equals("gwt-FileUpload")) {
                    targetElement = currentElement;
                    break;
                }
            currentElement = currentElement.getFirstChildElement();
        }
        if (targetElement != null)
            targetElement.setAttribute("multiple", "multiple");

Hello,

I have done the same like this. But the result is it upload the first image 
which I select with the name of the last image.

How to resolve this problem??
Thanks.

Original comment by wang541...@gmail.com on 10 Jul 2012 at 3:24

GoogleCodeExporter commented 8 years ago
See my comment on 21st of Nov 2011 - you have same issue, I think.

Original comment by to...@ekc.lt on 11 Jul 2012 at 11:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, I think we have the same problem.
Yesterday, I have modified the URL for “PreloadedImage” 
in”onFinishUploaderHandler”. So, it can display the correct images.

The problem is the status widgets and progress bar expect just the info of one 
file.
I hope we can have several status widgets and progress bars expect the info of 
each file or a status widget and progress bar expect the info of all the files. 
For example, display the File name of each file. How to resolve this problem?

Manolo said “servlet should be modified also” on 22nd Nov, 2011.
I just fallow the “gettingStarted”. How to modify it?
http://code.google.com/p/gwtupload/wiki/GwtUpload_GettingStarted

Original comment by wang541...@gmail.com on 12 Jul 2012 at 8:41

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Manuel,

as agreed to via mail, attached please find the patch for making multi-select 
available in browsers that support the necessary HTML5 features (patch is for 
latest revision c9b3a00df86f).

Please note that the patch also contains a new server-side feature to make it 
possible for users to overwrite the getSessionFilesKey() method and provide a 
random key with the session. This allows for a user to open multiple tabs with 
uploaders, upload files in each of those and call removeFromSession without 
deleting ALL the files (only the ones with the correct random number will be 
deleted). 
This feature is optional, i.e. existing uses will not be affected in any way.

Can use this in custom Servlet like:
    @Override
    protected String getSessionFilesKey(HttpServletRequest request) {
        return getSessionFilesKey(request.getParameter("randomNumber"));
    }

    public static String getSessionFilesKey(String parameter) {
        return "SESSION_FILES_" + parameter;
    }

A few words on the changes on multi-select:
- I implemented multi-select on the BrowserInputFile-type only.
- The JSUpload-project didn't build without perl which is why I didn't build it 
(but, apart from that, I see no reason why it should not build).
- The multi-select for MultiUploader is somewhat limited in that there will be 
only one progress bar even when two or more files are selected, and the table 
where uploaded file are stored has only one row per selection, i.e. will have 
multiple filenames in it. To work around this, users can implement their own 
OnFinishHandler and get the list of uploaded files from the uploader, then 
build a table on their own.
I really would have liked to implement this last one properly, but I don't have 
the time at the moment.
- On browsers that do not support the HTML-tag "multiple" (again, i.e. IE), the 
implementation will fall back gracefully to single-select.

If you have any questions, please feel free to contact me (preferably via 
elisabeth.bluemelhuber@cenarion.com).

Best regards,
Lisi

Original comment by e.blueme...@gmail.com on 5 Dec 2012 at 8:50

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in gwtupload-0.6.7-SNAPSHOT, revisions:
e4aac7bdd5e989f6f08207c17c31e5bdffe55395 
7d4c081435f84ee4032d33a00d5edf05cc598871 
801921ea08893a84b5bf633c030bbb155ec95066 
8fbc5c53d07d0b18d748f135f12ab1d876de8be2 

There are some things to fix: enable/disable the multiple feature, fix the max 
allowed files, allow cancel individual files after they are uploaded, etc.
Please, check the snapshot and report any issue your find.

Thank very much to  elisabeth.bluemelhuber at cenarion.com for the patch !

- Manolo

Original comment by manuel.carrasco.m on 5 Dec 2012 at 12:22

GoogleCodeExporter commented 8 years ago
BTW: Examples with multiple selection enabled are running at: 
http://gwtupload.alcala.org/

Original comment by manuel.carrasco.m on 5 Dec 2012 at 12:31

GoogleCodeExporter commented 8 years ago
I'm looking for a solution supporting HTML5 multiple selection uploads. I found 
the following issue for supporting this functionality in gwtupload: 
https://code.google.com/p/gwtupload/issues/detail?id=34. A patch by 
elisabeth.bluemelhuber is mentioned. I found it to be included in the 0.6.7 
snapshot, but when I try using the 0.6.7 snapshot of gwtupload and 
gwtupload-gae, I get the following error when uploading one or many files (the 
particular error below is for one single selected file):

Error uploading the file, the server response has a format which can not be 
parsed by the application.
<?xml version="1.0" encoding="UTF-8"?>
<response><field>GWTMU-04769285933515416</field>
<file><ctype>unknown</ctype>
<size>1</size>
<name></name>
<key>oaePdkfyrITfnZa4Lf96yg</key>
<blobkey>oaePdkfyrITfnZa4Lf96yg</blobkey>
</file>
<file><ctype>message/external-body; blob-key=d-pbu7kr9iqFQbJBKZNsog</ctype>
<size>1</size>
<name>0006 - 20120611 Familjen i USA, Orlando.jpg</name>
</file>
<file><ctype>unknown</ctype>
<size>1</size>
<name></name>
<key>d-pbu7kr9iqFQbJBKZNsog</key>
<blobkey>d-pbu7kr9iqFQbJBKZNsog</blobkey>
</file>
<finished>ok</finished>
<finished>ok</finished>
</response>

It seems the XML response from the GAE-app is somewhat different, and the 
client's XML parser is no longer able to parse the response when using multiple 
upload (I'm using the BlobstoreUploadAction). I tested it with 0.6.6, and it 
works fine there (although no multiple selection). Is this an error on my side?

I also have a question for the new multiple selection functionality: it seems 
when I select many files they are all grouped together and sent as one big POST 
request (the progress bar is for all the selected files, not individual files). 
Is this by design? I would very much prefer to have the files added to the 
queue in the same way they are added when I manually select the files one by 
one. Is this possible? As it is now, the limit of 3MB request size for normal 
(non-blobstore) requests is easily reached when selecting many files. If the 
files would be separated in different POST requests, I could multiselect 300 
1GB files and upload them to blobstore (as each POST request would be 1GB, as 
opposed to the current implementation where this would yield one POST request 
300GB in size). I would also be able to cancel individual uploads (as it is 
now, I must cancel the whole group of files). Any thoughts on this?

Original comment by jonas....@rsson.nu on 2 Jan 2013 at 11:13

GoogleCodeExporter commented 8 years ago
Hi Jonas,
I never tested the BlobstoreUploadAction, so it might well be that there is a 
bug left there. If you can provide me with a sample project, I'll try my best 
to find the time to fix it.

As for the other question, yes, this is by design (for now). I totally agree 
with you that it would be a lot nicer and more usability-friendly to have the 
files uploaded one by one even after multiselect but I didn't have the time to 
implement this and thus left it as it is now.

Best Regards
Lisi

Original comment by elisabet...@cenarion.com on 3 Jan 2013 at 8:51

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by manuel.carrasco.m on 31 Dec 2013 at 3:13