Home >Backend Development >PHP Tutorial >iOS sends a picture to the server, how to save the picture on the PHP side

iOS sends a picture to the server, how to save the picture on the PHP side

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-18 09:15:361229browse

As the title says, what was sent is binary. Can I write it directly into the file? The file suffix should be .png or .jpg or something

Reply content:

As the title says, what was sent is binary. Can I write it directly into the file? The file suffix should be .png or .jpg or something

Your interface now

<code>print_r($_FILES);
print_r($_POST);</code>

See what I print so I can decide the next step

Let the ios client tell you the file suffix, and then you just use file_put_content

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn