我正在嘗試使用mvc2的plupload,但filebrowser-window無法打開。Plupload Filebrowser無法打開
我的代碼:
<script type="text/javascript">
// Convert divs to queue widgets when the DOM is ready
$(function() {
$("#uploader").pluploadQueue({
// General settings
runtimes: 'gears,flash,silverlight,browserplus,html5',
url: '<%: Url.Content("~//Uploades/Horses/") %>',
max_file_size: '10mb',
chunk_size: '1mb',
unique_names: true,
// Resize images on clientside if we can
resize: { width: 320, height: 240, quality: 90 },
// Specify what files to browse for
filters: [
{ title: "Image files", extensions: "jpg,gif,png" },
{ title: "Zip files", extensions: "zip" }
],
// Flash settings
flash_swf_url: '../../../../Scripts/plupload/plupload.flash.swf',
// Silverlight settings
silverlight_xap_url: '../../../../Scripts/plupload/plupload.silverlight.xap'
});
// Client side form validation
$('form').submit(function (e) {
var uploader = $('#uploader').pluploadQueue();
uploader.refresh();
// Validate number of uploaded files
if (uploader.total.uploaded == 0) {
// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('UploadProgress', function() {
if (uploader.total.uploaded == uploader.files.length)
$('form').submit();
});
uploader.start();
} else
alert('You must at least upload one file.');
e.preventDefault();
}
});
});
<div id="uploader" style="height:300px">
<p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
</div>
如果我嘗試調試uploadingelemt是showen有任何問題。但是,如果我點擊添加文件,窗口只是跳到我的頁面的頂部,沒有其他事情發生。
Firebug不會顯示任何問題。
我在FF4 & IE 8嘗試使用Flash和Silverlight
任何一個的想法? 非常感謝,祝你週末愉快!
我得到同樣的東西,還沒有找到解決方案。 – balupton 2011-06-24 04:02:25
在flash_swf_url:屬性中做同樣的事情,你做了url:'<%:Url.Content(「〜// Uploades/Horses /」)%>'。可能無法解決問題,但它確保您的路徑是正確的。我遇到的最大問題是路徑被打破。 – 2011-07-07 23:32:55
您是否添加了所有相關的js依賴關係?你有沒有試過一個特定的運行時間,即HTML5或HTML 4? – Forer 2011-09-20 12:47:55