Drag and Drop files in Razor Pages

Blooming Developer 276 Reputation points
2021-08-31T01:48:25.317+00:00

Hi ,

I want to drag and drop attachments to a form, where the attached files should list down with delete and view option. when i submit this form its should save the files to server. Any help would be appreciated.

Thanks !

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce Barker 801 Reputation points
    2021-08-31T14:48:33.66+00:00

    What you want to do must be done with JavaScript

    https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/
    https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop

    Google for a lot more examples. One issues is the file list is read only, so you need a trick to implement the delete
    .
    https://stackoverflow.com/questions/3144419/how-do-i-remove-a-file-from-the-filelist

    0 comments No comments