- Home
- Forum
- JavaScript - EJ 2
- Drag and drop has null path
Drag and drop has null path
I have a file manager made and connected to a file system provider. I set allowDragAndDrop to true. I'm able to drag things within the file manager and it works, but when I try to drag files from windows, I noticed the 'path' string in the Upload ActionResult is null. Therefore, it doesn't upload. This is what I have:
public ActionResult Upload(string path, IList<System.Web.HttpPostedFileBase> uploadFiles, string action)
{
if (path == null)
{
return Content("");
}
FileManagerResponse uploadResponse;
uploadResponse = operation.Upload(path, uploadFiles, action, null);
if (uploadResponse.Error != null)
{
HttpResponse Response = System.Web.HttpContext.Current.Response;
Response.Clear();
Response.Status = uploadResponse.Error.Code + " " + uploadResponse.Error.Message;
Response.StatusCode = Int32.Parse(uploadResponse.Error.Code);
Response.StatusDescription = uploadResponse.Error.Message;
Response.End();
}
return Content("");
}
filemanagerInstance = new ej.filemanager.FileManager({
ajaxSettings: {
url: hostUrl + 'FileManager/FileOperations',
getImageUrl: hostUrl + 'FileManager/GetImage',
uploadUrl: hostUrl + 'FileManager/Upload',
downloadUrl: hostUrl + 'FileManager/Download'
},
view: "Details",
width: "325px",
height: "200px",
allowDragAndDrop: true,
allowMultiSelection: false,
enablePersistence: true,
toolbarSettings: { visible: false },
beforeSend: function (args) {
var data = JSON.parse(args.ajaxSettings.data);
data["folderPath"] = path;
args.ajaxSettings.data = JSON.stringify(data);
}
});
Thanks,
William
William
SIGN IN To post a reply.
1 Reply
1 reply marked as answer
SA
Shameer Ali Baig Sulaiman Ali Baig
Syncfusion Team
August 3, 2020 12:32 PM UTC
Hi William,
Greetings from Syncfusion support.
We have checked your reported issue with FileManager component based on your shared code snippet. Unfortunately, we were unable to replicate the issue from our side. Files are uploaded properly. Refer the below video footage.
Refer the attached video link.
Refer the sample link.
Note: Run the service and refer the local host URL in FileManager sample.
Refer the below links to know more about the FileManager component.
UG Documentation-https://ej2.syncfusion.com/javascript/documentation/file-manager/es5-getting-started/
Please let us know, if you need any further assistance.
Regards,
Shameer Ali Baig S.
Marked as answer
SIGN IN To post a reply.