PostApplicationUpdate example
Posted: Thu Jul 29, 2021 10:27 am
I built the PostApplicationUpdate example program for a NANO, and it works. But when I incorporate it into my application, it fails. One problem is that callback function SpecialFileReader never gets called.
Powerup init includes this:
I'm using the same webpage as the example, with just the name changed. When I open the webpage, select the s19 file, and click the update button, I get two error messages.
"File did not upload correctly"
"Stream update failure"
The file size argument of EnableMultiPartForms is confusing. In the example it's set to 10k, but the s19 file size is 356k. My app is 4.4M. So I'm not sure what that means. I don't think this is the problem, since the upload fails regardless of the value.
At the top of my post handler is this:
And it does make it inside the if statement. The function reprogram is the same function MyDoPost in the example.
What did I miss?
I'm using v2.9.5 of the tools.
Powerup init includes this:
Code: Select all
if ( EnableMultiPartForms( 5000000 ) ) // enable get the file over webpage.
{
RegisterSpecialLongFile("fw", SpecialFileReader); // register a callback function to read the update fw.
}
"File did not upload correctly"
"Stream update failure"
The file size argument of EnableMultiPartForms is confusing. In the example it's set to 10k, but the s19 file size is 356k. My app is 4.4M. So I'm not sure what that means. I don't think this is the problem, since the upload fails regardless of the value.
At the top of my post handler is this:
Code: Select all
if ( httpstricmp(url+1,"FWUPLOAD.HTM") == 1 )
{
#ifdef _DEBUG_SECURE_REPRO
puts( "FW Reprog" );
#endif
reprogram(sock, url, data, rxbuf);
return 0;
}
What did I miss?
I'm using v2.9.5 of the tools.