Skip to content

Instantly share code, notes, and snippets.

View yogyogi's full-sized avatar
🏠
Working from home

Yogi yogyogi

🏠
Working from home
View GitHub Profile
@yogyogi
yogyogi / Index.cshtml
Created June 19, 2021 13:48
ASP.NET MVC BlueImp jQuery File Upload
@{ Layout = null; }
<!DOCTYPE html>
<!--
/*
* jQuery File Upload Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
@yogyogi
yogyogi / HomeController.cs
Created June 19, 2021 13:51
ASP.NET MVC BlueImp jQuery File Upload
[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;
@yogyogi
yogyogi / JsonFiles.cs
Created June 19, 2021 13:53
ASP.NET MVC BlueImp jQuery File Upload
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);
@yogyogi
yogyogi / UploadFilesResult.cs
Created June 19, 2021 13:54
ASP.NET MVC BlueImp jQuery File Upload
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; }
}