小编use*_*472的帖子

创建在IE中工作的文件上传

我想编写一个在IE中工作的文件上传脚本,但我写的两种类型的代码在IE中都有问题.

请帮忙.你怎么能写一个在IE中工作的文件上传脚本?

类型1
问题不支持文件Api在IE中(不使用它的技巧?)

    <!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.6.2.js" type="text/javascript"></script>
    <script type="text/javascript">
        function updateSize() {
            var nBytes = 0;
            var nFiles=0;
            oFiles = document.getElementById("uploadInput").files;
            nFiles = oFiles.length;
            for (var nFileId = 0; nFileId < nFiles; nFileId++) {
                nBytes += oFiles[nFileId].size;
            }
            var sOutput = nBytes + " bytes";
            // optional code for multiples approximation
            for (var aMultiples = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"], nMultiple = 0, nApprox = nBytes / 1024; nApprox > 1; …
Run Code Online (Sandbox Code Playgroud)

html javascript ajax html5 file-upload

15
推荐指数
1
解决办法
5万
查看次数

标签 统计

ajax ×1

file-upload ×1

html ×1

html5 ×1

javascript ×1