我正在使用 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,因此您应该引用这篇文章。 您不需要任何处理程序。
关于c# - Dropzone.js:将图像上传到 ASP.NET 中的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23623160/