Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By martinayotte
#31295 Hi Mmiscool,

I don't have much time these days to debug other people's code, so I will leave you the homework ... ;)
But here are some hints :
- First, in the onFileUpload() callback, you need to follow the multiple calls behavior, so you need to have the upload.status checks for all UPLOAD_FILE_START/UPLOAD_FILE_WRITE/UPLOAD_FILE_END steps, this means having the SPIFFS.open/write/close accordingly in each steps.
- Due to multiple calls mentioned above, your SPIFFS file descriptor (File f) needs to be either global or static, since it need to be persistent across each onFileUpload() calls.
- For the compiles error, change the f.print() with f.write(), especially that it need to be done with argument upload.currentSize for each blocks been copied during each UPLOAD_FILE_WRITE calls, considering that you can have multiple calls, buffer limited to 2048 bytes by calls.

Hoping this help,
User avatar
By Mmiscool
#31468 That sketch was a tremendous help.

Also updated to sep 30 staging version. Things are looking much better.

Thanks for all the hard work you guys are putting in to this.