Stopping the upload process if the upload limit I chose is exceeded

℡╲_俬逩灬. 提交于 2019-12-10 22:56:39

问题


I am working on a web site project PHP/APACHE without any js until now.

I found out various ways to set the upload limit of an image to the server.

They work, but when I upload a very large one, the delay before the message "your file is too big" is from far too long. This means if a user does'nt understand what max 2.4MB is he will be likely to wait more than a minute or 2 before seeing the message.

My question is :

Do you know any mean to have the uopload automatically cancelled if the image he tries to transfer exceeds the limit ?

Thank a lot

SunnyOne.


回答1:


Basically, there are 2 ways to do this: With Flash/Java, or with fancy HTML5 JavaScript that only works on some browsers (and the most recent version of those, as well.

Check these other SO questions for pointers: Client Checking file size using HTML5? and Detecting file upload size on the client side?.

Also, check out these tools: YUI2 Uploader, FancyUpload, SWFUpload



来源:https://stackoverflow.com/questions/9851722/stopping-the-upload-process-if-the-upload-limit-i-chose-is-exceeded

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!