Home > Backend Development > PHP Tutorial > php://input 接收资料失败,图片变的非常小,无法打开

php://input 接收资料失败,图片变的非常小,无法打开

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:34:33
Original
899 people have browsed it

php://input 接收文件失败,图片变的非常小,无法打开
我用php://input 接收图片代码如下

<br />$file= file_get_contents('php://input');<br />   $this->filename=time().'.jpg';<br />   $dirname .='Uploads'.DIRECTORY_SEPARATOR.'face'.DIRECTORY_SEPARATOR.'1';  <br />   $url=$dirname.DIRECTORY_SEPARATOR.$this->filename;<br />   $handle=fopen($url, 'w');<br />   fwrite($handle, $file);<br />   fclose($handle);<br />
Copy after login

上传的图片有70多kb结果接收后保存下来只有70多字节,根本无法打开,我用var_dump()把接收的数据流打印出来是:image=955e0caajw1dwnvnfmwk4j.jpg&submit=%E4%B8%8A%E5%82%B3%E6%AA%94%E6%A1%88
这样对吗?该怎么解决这个问题?

图片 php 数据
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template