Home >Backend Development >PHP Tutorial >javascript - Use native js to submit images to the server, but the data cannot be received? (See description for details of code and screenshots)

javascript - Use native js to submit images to the server, but the data cannot be received? (See description for details of code and screenshots)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-09-15 11:30:56878browse

After capturing the packet, I saw an image like this, with more names such as these
Content-Disposition: form-data; Content-Type: image/jpeg

javascript - Use native js to submit images to the server, but the data cannot be received? (See description for details of code and screenshots)

Backend code

<code>$get = $_POST;
file_put_contents("./Upload/img/".time()."-avatar.txt",base64_decode($get));</code>

As a result, this txt is empty

Reply content:

After capturing the packet, I saw an image like this, with more names such as these
Content-Disposition: form-data; Content-Type: image/jpeg

javascript - Use native js to submit images to the server, but the data cannot be received? (See description for details of code and screenshots)

Backend code

<code>$get = $_POST;
file_put_contents("./Upload/img/".time()."-avatar.txt",base64_decode($get));</code>

As a result, this txt is empty

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