[英]HTML <input type=“file”… check filesize with Flash
I'd like to know how to use the JavaScript onChange
event on <input type="file"...
so that when a user selected files, onChange
will call Flash to return the file's size and decide what to do next. 我想知道如何在
<input type="file"...
上使用JavaScript onChange
事件,以便用户选择文件时, onChange
将调用Flash以返回文件的大小并决定下一步要做什么。
2nd. 第2位。 How to use JavaScript to exclude this check, if the browser doesn't have Flash.
如果浏览器没有Flash,如何使用JavaScript排除此检查。
You can use a part of FancyUpload project - http://digitarald.de/project/fancyupload/ . 您可以使用FancyUpload项目的一部分- http://digitarald.de/project/fancyupload/ 。 This control has a good documentation.
该控件有一个很好的文档。 Alternatively I use the client ActiveX
或者,我使用客户端ActiveX
var objFileSystem = new ActiveXObject("Scripting.FileSystemObject");
var strFilename = document.upload.file.value;
var resFile = objFileSystem.getFile(strFilename);
var intSize = resFile.size;
Check the Cross Browser Flash Detection in Javascript for 2nd issue 检查Javascript中的跨浏览器Flash检测是否存在第二个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.