HTTP PUT for file uploads

Grzegorz Nosek grzegorz.nosek at gmail.com
Tue Sep 9 11:43:35 MSD 2008


On pon, wrz 08, 2008 at 02:12:30 -0700, mike wrote:
> Does anyone know what would be easiest to add in to nginx? I assume
> most would require external libraries and I would like to keep nginx's
> footprint low and not require an excessive amount of external
> libraries.
> 
> The idea here would be the client encodes using one of these, and the
> server will decode, to ensure safe transfer of the file (please let me
> know Valery if you think this is totally not needed, I expect every
> segment to be checksummed anyway, so maybe it doesn't need to be)
> 
> uuencode/uudecode
> base64 encoding/decoding
> yenc (www.yenc.org)
> ? any other encoding methods ?

UU/base64 are quite similar (both are rather simple and expand the
encoded text by 33%), yenc I haven't heard of before. Do you *need* to
encode the chunks in any way? I'd probably send them raw with some
checksum (CRC32, MD4, MD5, SHA-something, depending on the application)
in headers.

BTW, if you keep the chunk size as a multiple of page size (usually 4K,
though you may encounter 8K and maybe more), you should be able to
mmap() chunks of the file for minimum overhead.

Best regards,
 Grzegorz Nosek





More information about the nginx mailing list