Write a copy of api for ios, but at first you can't catch the file size?.

I wrote an upload photo api for ios to use:

if($_FILES["cover"]["size"] != ""){
    // do....
}else{
    echo "error!";
}
The

counterpart bit is also cover and post matching
, but it just happens to be error!
can"t catch the file size
of the counterparty at all. How do you explain this?
is there anything else I need to configure here or on the other side?

update
whether php can print out Content-Disposition?


POST /test.html HTTP/1.1
Host: example.org
Content-Type: multipart/form-data;boundary="boundary"

--boundary
Content-Disposition: form-data; name="field1"

value1
--boundary
Content-Disposition: form-data; name="field2"; filename="example.txt"

value2
--boundary--

can php print this message?

Mar.04,2021

output the entire array to error.log, with error_log (var_export ($_ FILES,true)); ) and look at its structure.

< hr >

there are still updates. Okay. Try it:

<?php
$postdata = file_get_contents("php://input");
error_log(var_export($postdata, true));

see if you can output the POST request body

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c18e75-3314c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c18e75-3314c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?