Home > Backend Development > PHP Tutorial > 文件分片上传问题

文件分片上传问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:16:28
Original
1790 people have browsed it

文件分片上传中,在整个文件没有完全上传到服务器中的时候,服务端如何判断这个文件是否是合法的格式,如只允许上传图片,hacker通过工具来上传的其他的,这时候分片了。服务器完全接收后判断????这样是不是太低效了?

回复内容:

文件分片上传中,在整个文件没有完全上传到服务器中的时候,服务端如何判断这个文件是否是合法的格式,如只允许上传图片,hacker通过工具来上传的其他的,这时候分片了。服务器完全接收后判断????这样是不是太低效了?

php可能做不到,通过php只能拿到上传结束的完整文件,无法基于字节流来提前判断。

nginx作为web服务器理论上可行,不过需要你自己开发nginx插件,并通过判断最开始的字节判断是否是真的图片。

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template