This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UploadFilesResult | |
{ | |
public string name { get; set; } | |
public long size { get; set; } | |
public string type { get; set; } | |
public string url { get; set; } | |
public string deleteUrl { get; set; } | |
public string thumbnailUrl { get; set; } | |
public string deleteType { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JsonFiles | |
{ | |
public UploadFilesResult[] files; | |
public string TempFolder { get; set; } | |
public JsonFiles(List<UploadFilesResult> filesList) | |
{ | |
files = new UploadFilesResult[filesList.Count]; | |
for (int i = 0; i < filesList.Count; i++) | |
{ | |
files[i] = filesList.ElementAt(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public JsonResult Upload(HttpPostedFileBase files) | |
{ | |
var resultList = new List<UploadFilesResult>(); | |
string path = Server.MapPath("~/Content/uploads/"); | |
files.SaveAs(path + files.FileName); | |
UploadFilesResult uploadFiles = new UploadFilesResult(); | |
uploadFiles.name = files.FileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ Layout = null; } | |
<!DOCTYPE html> | |
<!-- | |
/* | |
* jQuery File Upload Demo | |
* https://github.com/blueimp/jQuery-File-Upload | |
* | |
* Copyright 2010, Sebastian Tschan | |
* https://blueimp.net |