jijo-paulose / gwtupload

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

Running in App engine throws java.io.FileOutputStream is a restricted class exception #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use Eclipse google web application run feature
2. try upload, it uploads and then fails

What is the expected output? What do you see instead?
It should upload without fail. It fails

What version of the product are you using? On what operating system?
Current Version

Please provide any additional information below.
You have 'isAppEngine()'  method to detect if It's an app engine, but still 
going further to use common io and creating temp file. I really want to use 
your api but in app engine hosted mode. Please help

Original issue reported on code.google.com by dagarwa...@gmail.com on 22 Aug 2010 at 6:35

GoogleCodeExporter commented 9 years ago

Are you using gwtupload-gae.jar and extending AppEngineUploadAction?

Anyway, AppEngine is a very experimental feature in gwtupload due to the strict 
restrictions of the GAE platform.

Original comment by manuel.carrasco.m on 23 Aug 2010 at 1:38

GoogleCodeExporter commented 9 years ago
Issue 70 has been merged into this issue.

Original comment by manuel.carrasco.m on 23 Aug 2010 at 1:38

GoogleCodeExporter commented 9 years ago
I am using gwtupload-gae.jar. not extending AppEngineUploadAction. 
I dug around it and found that I might need to make a custom FileItemFactory 
which does not make use DiskFileItem. 

Well I am now dropping gwtupload-gae.jar and going to use gwt FileUpload for 
simple upload and using blob to store the images in datastore. 

I want to use Google App Engine to host my web application.

Original comment by dagarwa...@gmail.com on 23 Aug 2010 at 1:43

GoogleCodeExporter commented 9 years ago
gwtupload + gwtupload-gae has the option of using blobstore, unfortunately 
there is no way to track the upload progress.

Original comment by manuel.carrasco.m on 23 Aug 2010 at 1:53

GoogleCodeExporter commented 9 years ago
Ok Thanks, 

Any link to the example how to use blobstore using gwtupload + gwtupload-gae 
would be great.

However, I am not using Blobstore but following is the way I am doing it : 

ServletFileUpload upload = new ServletFileUpload();
FileItemIterator iter = upload.getItemIterator(request);
FileItemStream imageItem = iter.next();
InputStream imgStream = imageItem.openStream();
Blob imageBlob = new Blob(IOUtils.toByteArray(imgStream));

and then passing this blob to JDO.
there is a method Blob.getBytes() which might be used in some way to send the 
progress back to the client

Original comment by dagarwa...@gmail.com on 23 Aug 2010 at 2:03