marufbd / MvcFileUploader

A nuget package for easy blueimp JQuery file upload plugin integration into an ASP.NET Mvc application
MIT License
39 stars 22 forks source link

FileSaver.StoreFile with custom FileName set still uses Request filename #8

Closed marufbd closed 10 years ago

marufbd commented 10 years ago
var st = FileSaver.StoreFile(x =>
                {
                    x.File = Request.Files[i];
                    //note how we are adding an additional value to be posted with delete request
                    //and giving it the same value posted with upload
                    x.DeleteUrl = Url.Action("DeleteFile", new { entityId = entityId });
                    x.StorageDirectory = Server.MapPath("~/Content/uploads");
                    x.UrlPrefix = "/Content/uploads";// this is used to generate the relative url of the file

                    //overriding defaults
                    x.FileName = "Sample.jpg";// does not work. still takes name from Request.Files[i].FileName
                    x.ThrowExceptions = true;//default is false, if false exception message is set in error property
                });