2013-02-14 56 views
0

我正在使用YUI 3上傳器。
我拿這個例子從給定的參考網址:
http://yuilibrary.com/yui/docs/uploader/uploader-multiple.htmlYUI 3上傳者在IE中使用

我有IE.8版本。
我創建一個PHP文件說test.php的,並從給定的URL寫的腳本 下面給出:

<script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js"></script> 
    <script> 

    YUI({filter:"raw"}).use('uploader', function(Y) { 
    Y.one("#overallProgress").set("text", "Uploader type: " + Y.Uploader.TYPE); 
    if (Y.Uploader.TYPE != "none" && !Y.UA.ios) { 
    var uploader = 
     new Y.Uploader({width: "250px", 
       height: "35px", 
       multipleFiles: true, 
       swfURL: "http://localhost.com /test/flashuploader.swf?t=" + Math.random(), 
       uploadURL: "http://localhost.com/test/test.php", 
       simLimit: 2, 
       withCredentials: false 
     }); 
    }); 

當我在IE中打開這個頁面,什麼都不會發生,沒有文件對話框打開以選擇文件。

如果有人已經解決了這個問題,請告訴我該如何解決?

謝謝,

+0

http://localhost.com /test/flashuploader.swf IA在IE(空間)無效網址。也不清楚它是否在其他瀏覽器中工作?因爲你不粘貼整個代碼,只是初始化器,附加事件在哪裏? – Eduard 2013-02-14 10:12:55

+0

http://yuilibrary.com/yui/docs/uploader/uploader-multiple.html這是在ie8上工作,只是測試。比較你所擁有的全部源碼 – Eduard 2013-02-14 10:20:07

+0

感謝您的回覆。 我使用URL(http://yuilibrary.com/yui/docs/uploader/uploader-multiple.html)給出的整個代碼。但仍然無法正常工作。 – 2013-02-14 10:42:19

回答

0
I have used all source code from below url: 
    http://yuilibrary.com/yui/docs/uploader/uploader-multiple.html 

    and 
    <script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js"></script> 
    to create instance the uploader. 

    We need to just replace another version file of yui-min.js file as below 
    <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> 

    Apart from js file we need to change these 
    swfUrl: http://mudomain.com/test/flashuploader.swf 
    UploadeUrl: http://mudomain.com/test/uploader.php 

    To Upload file on the server, just write the script in the given above page in 
    the uploadUrl "uploader.php" as 

    <?php 
    $uploadedPath = 'Uploaded_Files/'; 
    foreach ($_FILES as $fieldName => $file) { 
     move_uploaded_file($file['tmp_name'], $uploadedPath.$file['name']); 
    } 
    ?> 

    Now you will see all selected files will be uploaded. 

    But there is limitation in the IE, We can upload 1 to 5 files at a time.