Issue #1223Opened June 20, 2018by ogousseau0 reactions

[Question]Asset Manager Upload in ASP.Net

Question

I want to save file when i upload in dropzone, to do in init

        assetManager: {
            upload: '/SuperAdmin/UploadAsset',
            uploadFile: function (e) {
                var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;
                // ...send somewhere
                console.log(files);

                var formData = new FormData();

                for (var i in files) {
                    formData.append('file-' + i, files[i])
                }

                $.ajax({
                    url: '/SuperAdmin/UploadAsset',
                    type: 'POST',
                    data: formData,
                    contentType: false,
                    crossDomain: true,
                    mimeType: "multipart/form-data",
                    processData: false,
                    success: function (result) {
                        console.log(result);

                    }
                });
            }

And in my Controler ASP.Net SuperAdmin :

        public JsonResult UploadAsset(string formdata)
        {
           return Json(object(?), JsonRequestBehavior.AllowGet);
        }

But formdata is always null ???

What i wrong ? (i'm beginer why JSon)

Merci beaucoup.

Answers (2)

artfJune 24, 20180 reactions

Check via devtool if the request is sent from your browser, the server part is up to you, can't help you there

lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.