https://github.com/vndevpro/dropzonemvc
An easy file upload handler in ASP.NET MVC with DropzoneJS
https://github.com/vndevpro/dropzonemvc
Last synced: 9 months ago
JSON representation
An easy file upload handler in ASP.NET MVC with DropzoneJS
- Host: GitHub
- URL: https://github.com/vndevpro/dropzonemvc
- Owner: vndevpro
- Created: 2016-12-31T08:15:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T14:39:05.000Z (over 2 years ago)
- Last Synced: 2025-05-12T00:41:30.329Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 7.71 MB
- Stars: 9
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DropzoneMvc
MVC controller and file upload handling in ASP.NET MVC
(https://www.nuget.org/packages/DropzoneMvc/)
# Steps to install it on your MVC App
1. Put into web.config the below keys in AppSettings (this will be used by DropzoneAttachmentController)
```
```
2. Install the package into your app:
Install-Package DropzoneMvc
3. In your view (the form) add the following
@{
Html.RenderAction("GetComponent", "DropzoneAttachment", new { referenceId = Model.Id });
}
4. In POST action of the controller
var tempFilesFolder = Server.MapPath(ConfigurationManager.AppSettings["TempFilesRoot"]);
var files = new DropzoneMonitor(Request).GetActiveUploadedFiles(tempFilesFolder);
// file will be the full path minis the TempFilesRoot
Now you get all the files, just save them as your logic requires.
Please check some notes below:
/!\ JQuery must be configured & put in head tag
/!\ Dropzone js and css bundles must be declared (in BundleConfig.cs file) -> these bundles will be referenced by the view _DropzoneComponent.cshtml (in **DropzoneMvcDemo\Views\Shared**)
/!\ You must have to config an IoC for IDropzoneAttachmentSecurityCheck => Check the demo setup with SimpleInjector