HTTP PUT for file uploads

Valery Kholodkov valery+nginxen at grid.net.ru
Sat Sep 6 15:45:08 MSD 2008


mike wrote:
> I've put together what I think is a decent solution below:
> http://michaelshadle.com/2008/08/26/large-file-uploads-over-http-the-final-solution-i-think/

1) multipart/form-data does not bloat the size of the file, it doesn't 
encode anything. rfc 1867 doesn't explicitly say that there any encoding 
should be applied;
2) the ideal solution is to have byte ranges instead of Segment ID, 
since concatenation of parts is not a _scalable operation_. With byte 
ranges the server will be able to put the part into the proper place in 
the file, while leaving other parts empty. I.e. if I have two parts
with byte ranges 0-19999/80000 and 40000-59999/80000, I can lseek to the 
second part and start writing two parts simultaneously:

|<-- part1 0-19999/80000 -->|<-- zeroes 000000 -->|<-- part2 
40000-59999/80000 -->|

-- 
Regards,
Valery Kholodkov





More information about the nginx mailing list