On Apr 8, 11:00 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Anna PS wrote:
> > OK, I see. Although, I do get the OutofMemoryError on the
> > byteBuffer.write(buffer, 0, len), well before I do anything with the
> > FilePart.
>
> That doesn't make sense. What are you doing with the 1 KB you read in
> each time? I assumed you were feeding that into the FilePart.

Not directly - the videoByteArray is used for the FilePart once I have
the whole thing, like this:

    videoByteArray = getBytesFromFile(cR, fileUriString);
    FilePart videoFile = new FilePart("fileupload", new
ByteArrayPartSource(
                                        "fileupload", videoByteArray));
    videoFile.setContentType("video/3gpp");
    videoFile.setCharSet(null);
    Part[] parts = {
            new StringPart("name", name),
            videoFile };

But I get the error on the first line of that code, in the readBytes
that's called from getBytesFromFile.

I guess this is all academic if I need to rewrite it to use HttpPut,
anyway...

> > It is my Web server, so I can rewrite it to accept a PUT request. Are
> > you suggesting that I do something like this, for each 1MB of the
> > data?
>
> >    HttpPut httpPut = new HttpPut(url);
> >    httpPut.setEntity(new StringEntity(data));
>
> I'd use ByteArrayEntity.

Thanks.

To ask a dumb question, as someone who hasn't used chunked uploading
before: how can I indicate to the server the order in which to glue
the chunks back together? (Tell me to go away and ask a Java forum if
you want.)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to