marufbd/MvcFileUploader

FileSaver.StoreFile with custom FileName set still uses Request filename

marufbd opened this issue · 0 comments

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
                });