Hi…
[Android]
Code that used to work to upload to my web server, using network.upload, is now failing (I hadn’t tried it for a year, and I’ve edited/recompiled various things since then … but no changes in my separate “upload.lua” file (just in my main.lua file).)
The network.upload call is returning an undocumented result of ‘false’. (The documentation states it returns a handle). (And, FYI, the next two return parameters appear to be empty strings…I hoped it might be something like ‘err, errs’ as some things return, so I checked : )
The upload works on the simulator, but on a real Android after about 4 seconds I get a completion
event (which would imply that the “network.upload” request successfully started the upload!!!),
and the ‘event’ parameter for it shows:
{
["responseHeaders"] = {
["Connection"] = "close";
["Content-Length"] = "18";
["X-Android-Response-Source"] = "NETWORK 400";
["Date"] = "Mon, 23 Aug 2021 05:15:14 GMT";
["X-Android-Sent-Millis"] = "1629695713494";
["X-Android-Selected-Protocol"] = "http/1.1";
["X-Android-Received-Millis"] = "1629695720425";
["X-Powered-By"] = "PHP/7.3.23";
["Content-Type"] = "text/html; charset=UTF-8";
["HTTP-STATUS-LINE"] = "HTTP/1.1 400 Bad Request";
["Server"] = "Apache/2.4.48 (Amazon)";
};
["responseType"] = "text";
["phase"] = "ended";
["bytesEstimated"] = 7343549;
["response"] = "Malformed Request\
";
["name"] = "networkRequest";
["bytesTransferred"] = 7343549;
["status"] = 400;
["url"] = "http://photos.myservername.com/photos/upload.php?phlxauth=SBlucuu";
["isError"] = false;
["requestId"] = "false";
};
Note that the “bytesTransferred” is 7 MB, further implying that the upload worked.
I suspect the answer is probably “your webserver (or PHP code) returned 404”, but
that ‘false’ return from network.upload is a very large unanswered question.
(Both the simulator and the phone are talking from the same local net, to the same remote webserver (name slightly obscured in the above).)
Any suggestions?
thanks,
Stan