php-multipart/form-data上传图片 解析为空

WBOY
Release: 2016-06-02 11:28:44
Original
1741 people have browsed it

phphtml

如题 提交格式如下
Content-type: multipart/form-data, boundary=aaaaa

--aaaaa
content-disposition: form-data; name="name"

aaaa
--aaaaa
content-disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png

// 这里是关于图片的解码
--aaaaa--

PHP进行解析
$newfilename = "photo/".$_POST['name']."/".$_FILES["image"]["name"];
echo $newfilename;
if(move_uploaded_file($_FILES["image"]["tmp_name"], $newfilename))
{
echo "上传成功!
";
}
打印结果:photo//
name和图片信息都没有获取到 求帮助....
如果我写的不对,应该怎么写呢?

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!