如果超出了我选择的上传限制,则停止上传过程 [英] Stopping the upload process if the upload limit I chose is exceeded

查看:83
本文介绍了如果超出了我选择的上传限制,则停止上传过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我正在开发一个没有任何js的网站项目PHP/APACHE.

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.

它们可以工作,但是当我上传一个很大的文件时,您的文件太大"消息之前的延迟太长了.这意味着,如果用户不知道最大为2.4MB,则可能会等一两分钟以上才能看到消息.

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.

我的问题是:

如果他尝试传输的图像超出限制,您是否知道自动取消uopload的任何手段?

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

非常感谢

SunnyOne.

推荐答案

基本上,有两种方法可以执行此操作:使用Flash/Java或仅在某些浏览器上可用的新颖的HTML5 JavaScript(以及那些.

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.

检查以下其他SO问题以获取指针: 客户端使用HTML5检查文件大小?

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

还请检查以下工具: YUI2上传器 SWFUpload

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

这篇关于如果超出了我选择的上传限制,则停止上传过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆