views:

479

answers:

2

I'm making a http server that merely allows access to my folder, download the files in it and also uploading to a folder. So far I have already done most of it, the only thing left is the uploading of the files. Whenever I receive files from a client, they send chunked datas. Which I dont understand to decode. All I need is a function that decodes the data that i receive on my socket. Or even a way so that I could unallow the browser to send a Chunked transfers. Thanks in advance. ^^

+1  A: 

kind of duplicate here

LB
whoa thanks! :)I over looked that one. ^^"
Hmmm, sorry but I dont understand that pseudo-code that much. :(A code for c would be nice, if there is any. :)
Go to the specification and try to understand it - it is meant to be clear enough to be understood. I'd allow that 'read chunk-data and CRLF' doesn't make it 100% explicit that you need to read chunk-size bytes of chunk-data, but it doesn't take a lot of meditation to realize that it is what is meant.
Jonathan Leffler
A: 

Chunked transfer is part of the HTTP/1.1 spec. If your server only responded with HTTP/1.0 responses, I would expect the client to upload the data without using chunks.

David
Hmm, well im not sure. I always respond to the client its 1.0 but for what ever reason, each time the client uses the upload form I supply to them. It always gives me a chunk, the header also says HTTP/1.1