How does php receive images uploaded to the web by iOSapp? Before receiving a file, you need to determine whether to upload the file. Control the size of the uploaded file {code ...} judge by definition {code ...} determine whether there is a value {code ...} but there is a big problem... how does php receive images uploaded to the web on iOS app?
Before receiving a file, you need to determine whether to upload the file.
Control the size of uploaded files
$_FILES["file"]["size"]
Determined by definition or not
isset($_POST['file'])
Determine whether there is a value
empty(file_get_contents("php://input")
However, there is a big problem currently. If you have set the judgment, you will not be able to upload the file.
If the file is directly uploaded without adding any conditions, the file will be uploaded successfully.
move_uploaded_file($_FILES["file"]["tmp_name"], "./img/" . $_FILES["file"]["name"]);
How do I receive files sent via ASI?
Does he have a key value?
Is the forkey in the following statement a key?
[request setPostValue:@"" forKey:@"file"];
Reply content:
How does php receive images uploaded to the web on iOS app?
Before receiving a file, you need to determine whether to upload the file.
Control the size of uploaded files
$_FILES["file"]["size"]
Determined by definition or not
isset($_POST['file'])
Determine whether there is a value
empty(file_get_contents("php://input")
However, there is a big problem currently. If you have set the judgment, you will not be able to upload the file.
If the file is directly uploaded without adding any conditions, the file will be uploaded successfully.
move_uploaded_file($_FILES["file"]["tmp_name"], "./img/" . $_FILES["file"]["name"]);
How do I receive files sent via ASI?
Does he have a key value?
Is the forkey in the following statement a key?
[request setPostValue:@"" forKey:@"file"];
The PHP program is executed only after the file is uploaded. That is to say, you cannot use the PHP program to determine and block the file upload, because the file has been uploaded to the server when the program is running.
You only need to let the client first pass the basic information of the file to be uploaded to another PHP program, the program determines whether the file is allowed to be uploaded through the information, and then upload the image through this address.