[vip-help] Need help with POST request

Han, Yue han380 at purdue.edu
Fri Mar 29 10:54:47 EDT 2024


Hi Andy,

I recommend you to write some debugging output in the php file to check whether the image is successfully POST to server and see the result of the base64_decode.

I think the key is checking the output of base64_decode.

You can search more for “base64_decode”, this function will return false if your upload data is not encoded in base64 format.

And if you check the Android code sending POST to this php file, you will see it is not directly sending image, it convert the bitmap to String and then send to the php.

If you want directly sending image, you don’t need “base64_decode” here, you can simply write php got to get the image/file from POST and save it without decode.

Best,
*****
Yue Han
Ph.D. Candidate
Research Assistant
Video and Image Processing Laboratory (VIPER)
School of Electrical and Computer Engineering
Purdue University
465 Northwestern Avenue
West Lafayette, IN 47907-2035
U.S.A.
Telephone: +1 765 637 3729
email: han380 at purdue.edu
URL: https://lorenz.ecn.purdue.edu/~han380/
*****

On Mar 29, 2024, at 10:21, Lam, Andy <lam138 at purdue.edu> wrote:

Some people who received this message don't often get email from lam138 at purdue.edu<mailto:lam138 at purdue.edu>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
<image.png>
Hello,

I am having trouble with sending a POST request with an image in my local directory and getting it to save. Above is my code and the output
--
vip-help mailing list
vip-help at ecn.purdue.edu<mailto:vip-help at ecn.purdue.edu>
https://engineering.purdue.edu/ECN/mailman/listinfo/vip-help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ECN/mailman/archives/vip-help/attachments/20240329/643582b3/attachment.htm>


More information about the vip-help mailing list