[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)
Check via devtool if the request is sent from your browser, the server part is up to you, can't help you there
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.
Issue #998
[BUG] Asset Manager sends empty request when uploading image
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The conte...
Issue #1418
[BUG?] Asset manager not deleting files on server unless upload triggered.
Running latest version (0.14.29) on local server. Using the example webpage preset. Ubuntu 18.04, Chromium 68. Assetmanager init: And exten...
Issue #507
uploadFile being called twice on drop file?
I have an editor initialized as so: If I add an image to the canvas and try to upload a new image by dragging it into the drop area in the...
Issue #646
Images dropped onto image picker get uploaded twice
Set the asset manager with the dropzone option set to true (which is true by default), something like that: then drop an image onto the dro...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.