jijo-paulose / gwtupload

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

FilesApiUploadAction concatenating KeyStrings #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using FilesApiUploadAction to upload files.

What is the expected output? What do you see instead?
When i upload one file the executeAction(..) return two keys (concatenating of 
them) instead one key of upload file.

What version of the product are you using? On what operating system?
gwtupload-gae-0.6.4.jar, Gwt 2.4.0, Ubuntu 11.04.

Please provide any additional information below.

I'm not sure but the FilesApiUploadAction is capturing two files. First is the 
form (i guess) and the second one is the file i want to upload.

My solution is to discard the first key and only return the second one.

The code:

public class DatastoreUploadAction extends FilesApiUploadAction { 
    @Override
    public String executeAction(HttpServletRequest request,
            List<FileItem> sessionFiles) throws UploadActionException {
        String ret = "";
        for (FileItem i : sessionFiles) {
            // Solucion sucia.
            if (i.getSize() >= 1024L){
                ret = ((FilesAPIFileItem) i).getKey().getKeyString();
                logger.info("Received new file, stored in blobstore with the key: " + ret); 
            }
        }
        return ret;
    }
}

This code is only go to work with single upload, I dont know the proper manner 
to do a correctly fix, to function with all the gwt-upload library.

Thanks in advance
Juan Manuel

Original issue reported on code.google.com by juanma.v82@gmail.com on 3 Apr 2012 at 7:56

GoogleCodeExporter commented 9 years ago
Fixed in r986

Thanks for reporting
- Manolo

Original comment by manuel.carrasco.m on 23 May 2012 at 4:04

GoogleCodeExporter commented 9 years ago

Original comment by manuel.carrasco.m on 30 Nov 2012 at 9:14