Home  >  Article  >  Backend Development  >  curl上传图片文件的问题。

curl上传图片文件的问题。

WBOY
WBOYOriginal
2016-06-23 14:16:56818browse

图片 Curl

curl 上传文件时服务端接受到的$_FILES['xxx']['type'] 是application/octet-stream,怎样才能得到图片的原始类型?

回复讨论(解决方案)

getimagesize($_FILES['xxx']['tmp_name'])['mime']

getimagesize($_FILES['xxx']['tmp_name'])['mime']

忘了这种方法了,还有用方法,在curl的时候
@/filename;type=image/jpeg
这样也可以,不过服务端获取到的file_type 是 type=image/jpeg

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