2011-09-28 68 views
1

我使用uplodify在zend中上傳文件。Zend Framework中的Uploadify

<link href="/uploadify/uploadify.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="/uploadify/jquery-1.5.2.min.js"></script> 
<script type="text/javascript" src="/uploadify/jquery.uploadify.min.js"></script> 
<script type="text/javascript" src="/uploadify/swfobject.js"></script> 
<script type="text/javascript" src="/uploadify/jquery.uploadify.js"></script> 
<script type="text/javascript"> 
$(document).ready(function() {  
     $('#file_upload').uploadify({ 
     'uploader': '/uploadify/uploadify.swf', 
     'script': '/upload/upload', 
     'cancelImg': '/uploadify/cancel.png', 
     'folder': '/uploadify/uploads', 
     'auto': true 
     }); 


}); 
</script> 
<input id="file_upload" name="file_upload" type="file" /> 

此代碼在視圖部分index.phtml。 但是,當我在我的web devloper工具來運行我的Web應用程序,我看到它顯示在控制檯

NetworkError: 404 Not Found - http://localhost/upload/uploadify.swf?preventswfcaching=1317192234400 

幫我SOLV這個問題....

回答

2

指定的路徑是錯誤的地方。

在jquery函數中,它給出爲;從那裏請求去爲 「上傳/ uploadify.swf」

'uploader': '/uploadify/uploadify.swf',

聯繫,以獲得一個404錯誤。

此外,如果您使用的是.htaccess文件,請確保這些文件的請求不會被拒絕。

4

「一些選項名稱的V3已經改變更加直觀。在‘上傳’選項現在應指向PHP腳本。在‘瑞士法郎’選項將指向Flash文件。」

http://www.uploadify.com/forums/discussion/7296/uploader-being-rewritten-in-v3.0.0/p1的代碼

部分:

$("#gallery").uploadify({ 

    id : jQuery(this).attr('id'), 
    langFile : 'http://www.static-xxx.nu/uploader/uploadifyLang_en.js', 
    swf : 'http://www.static-xxx.nu/uploader/uploadify.swf', 
    uploader : '/uploadify/galleri.php',