Hello
Im looking for a way to upload binary file update for a device connected to the wifi board. Details of the problem bellow:
Im am running the http server ported via the portable example, as in the simplelink academy. Temp readouts and LED control works. Uart display has been disabled and uart is converted to other uses.
I have registered the URL at number 3 for the request as /update,and given it characteristic of "file.name" and "file", which are also my form members, at the appropriate places in the initHttpserverDB() function.
The form with the contents of file.name=filename and file=filecontent is sent properly using ajax with the url="/update", data=formdata and enctype= "multipart/form-data". I have raised the number of URI services to 4.
Due to the nature of the binary file(not necessarily ascii data), "application/x-www-form-urlencoded" is not a valid enctype, as far as i know "multipart/form-data" must be used.
The server enters the postHandler, then httpCheckContentInDB, parsing metadata returns 0(no error). parseUrlEncoded returns -1. As far as i can tell this is because of the enctype used (multipart/form-data does not necessarily use "&" to seperate the characterictic-value array.)This means my callback registered in DB for /update will not be entered.
At the point of faliure i can see my form in the pPhrase variable in parseUrlEncoded
The browser console shows the following:
"
My first question is, am I doing something wrong? Have i missed something obvious that would make this work as is?
My main question is, if i have to create a new handler for multipart/form-data enctype, what would be the propper/efficient way to do it? Should i simply redirect it from the existing one based on requestIdx? Is there a different way, without breaking anything?