HTTP multipart and boundary question

cbfk23

New Member
Hi,
I am thinking to use HTTP multipart to return a dynamically generated binary stream (such as an mp4 video clip), followed by a signature file and then other contents to a client in one single HTTP response message. In my case, the mp4 size (the first part of the response message) is unknow when building the http header fields so I can't set Content-Length for the mp4 part. I will need to use multipart boundary to separate each part. However I was advised that if the boundary string appeared in the mp4 data, the multipart wouldn't work. Other people suggested to encode each part (such as BASE64 encoding) so that I can choose a boundary with non-BASE64 characters which will never appear inside any part of the http response. The issue is that BASE64 would increase size by 33% which is an overhead we can't accept.
The question is:
Is there a way to workaround this? Have I missed something? or May be you know a better way to do it (we have to return several parts in one single HTTP response)?

Many thanks,
 
Back
Top