MG_EV_HTTP_CHUNK Questions #1499
-
MG_EV_HTTP_CHUNK Questions I am migrating from 6.x to 7.x, specifically addressing the multipart uploads. Our 6.x code processed all the events to deal with multipart and worked well to upload very large files. I am unsure of the best way to migrate to 7.x in this area. I attempted these 2 things:
To attempt the first one, I processed MG_EV_HTTP_CHUNK and did this each time through:
This gave me my entire file, but when the next file was sent, the entire message was treated as data of the first file by Mongoose. It seemed I didn't properly tell Mongoose code that the file was done or interfered in that somehow. Is there something more I need to do when processing each chunk than just calling delete_chunk? To attempt the second item above, I wanted to process the "first" MG_EV_HTTP_CHUNK for each file sent.
This seems to work for me, despite the documentation stating that the LAST chunk will have a size of 0, but says nothing of the first. However, this ultimately has a file size limit of MG_MAX_RECV_BUF_SIZE. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
Is there something more I need to do when processing each chunk than just calling delete_chunk?
- send response when the last chunk is received. See https://github.com/cesanta/mongoose/blob/master/examples/file-upload/main.centire message was treated as data of the first file by Mongoose
- I did not get this question. Could you expand on this please?