Hi Stefan,

Our understanding is that GAE simply does not support chunked encoding, at
all! Hence the necessary entity buffering workaround...

Note that the default entity buffering mechanism is memory based, so you
shouldn't use it to store 100 Mb unless you have a really large machine and
few request. It is possible to cache it in a file and send send this file to
GAE via FileRepresentation. As the file size is known, you won't rely on
chunked encoding.

In your case, you might have to redesign your upload strategy.

Best regards,
Jerome
--
http://www.restlet.org
http://twitter.com/#!/jlouvel



-----Message d'origine-----
De : Stefan L [mailto:[email protected]] 
Envoyé : mardi 20 septembre 2011 12:51
À : [email protected]
Objet : restlet chunked encoding

Hi,

i am using restlet-gae-2.1m7 on server side (Google AppEngine) and
restlet-jse-2.1m7 for the client development. I want to upload large files
to the server, so i have to use chunked encoding, because AppEngine only
supports requests up to 32mb.

My client code looks like:

         FormDataSet form = new FormDataSet();
         form.setMultipart( true );
         form.getEntries().add( new FormData( "file", new
FileRepresentation( file, MediaType.APPLICATION_OCTET_STREAM ) ) );
         form.getEntries().add( new FormData( "ownerId", new
StringRepresentation( patientId ) ) );

         ClientResource client = new ClientResource( serverUrl +
filesResource );
         client.setRequestEntityBuffering( true );
         client.post( form );

My server side code:

         RestletFileUpload rUpload = new RestletFileUpload();
         rUpload.setProgressListener( new MyProgressListener() );
         FileItemIterator it = rUpload.getItemIterator( multipartForm );

         while( it.hasNext() )
         {
             ...
         }

But actually i cannot upload files up to 100mb. If i uncomment this
line: client.setRequestEntityBuffering( true ); i get "Length Required
(411) - Length required". When i set 'setRequestEntityBuffering' to true i
get the following error for files up to 100mb: Internal Connector Error
(1002) - Unexpected error detected. Closing the connection.

Do you have an idea what's going wrong here?

Thanks,
Stefan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=28421
86

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2842275

Reply via email to