[英]Dropzone.js: Upload images to server in ASP.NET
我正在使用dropzone.js將圖像上傳到瀏覽器。 我需要將這些圖像上傳到服務器。 我是否需要使用Handler.ashx來獲取圖像,我該怎么做? 這是我的代碼
$(document).ready(function (obj) {
Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element
// The configuration we've talked about above
url: '#',
previewsContainer: ".dropzone-previews",
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100,
dictDefaultMessage: "",
accept: function(file, done) {
//in here I can access each file that dropping on to the browser
},
init: function () {
this.on("drop", function (file) {
});
this.on("uploadprogress", function (file, progress) {
//if (progress == 100) {
console.log(progress);
//}
});
this.on("maxfilesexceeded", function (file) {
alert("No more files please!");
});
this.on("complete", function (file) {
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
alert(file.name);
}
});
}
}
createDropzone();});
我是這個領域的新手,有什么幫助嗎?
我用mvc做了這個。所以我不需要任何處理程序來做這件事。 使用javascript上傳文件。
由於您使用的是普通的asp.net,這里有一篇您應該參考的帖子。 你不需要任何處理程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.