c# - Dropzone.js:将图像上传到 ASP.NET 中的服务器

标签 c# javascript jquery asp.net dropzone.js

我正在使用 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,因此您应该引用这篇文章。 您不需要任何处理程序。

https://stackoverflow.com/a/16051735/3156647

关于c# - Dropzone.js:将图像上传到 ASP.NET 中的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23623160/

相关文章:

c# - Array.Clear 实际上做了什么?

c# - 在 c# Windows 应用程序中从雅虎发送邮件时出现身份验证错误

javascript - json值的长度?

javascript - 焦点去哪儿了?

javascript - CSS 相当于 .attr ("data-html", "true")

c# - 终结器和析构函数,维基百科是怎么说的?

javascript - 转义 HTML 字符

jquery - float Div 溢出滚动浏览器

javascript - 简单模式弹出窗口?

c# - 函数错误之间的模糊调用