Re: Convert StreamResponse to Asset

2013-06-24 Thread Boris Horvat
Yea and when I think about it a bit more keeping it in memory will be a problem if the user is directed to a different server... OK I will solve this by uploading an image to some persistent storage (i.e. S3) and then server it as an asset. Thanks On Mon, Jun 24, 2013 at 10:38 AM, Lance Java wrot

Re: Convert StreamResponse to Asset

2013-06-24 Thread Lance Java
Firstly, it's dangerous to hold a reference to an UploadedFile instance after the request that created it has reached end of life. You must read the InputStream whilst the request is live and store it somewhere (either in a database, a blobstore or as a byte array in the HTTPSession etc). If you'd

Convert StreamResponse to Asset

2013-06-23 Thread Boris Horvat
Hi all, When I upload a file I would like for it to stay in memory for a bit until user decides if he wants to save it or not (he can also then use the from to add some more information about the file). To achieve this I have created a class public class UploadedFileStreamResponse implements Str