I have form with dynamic file upload:
var ordinaryPropertyValue = new Catalog.Core.Entities.OrdinaryPropertyValue();
var fileFile = Request.Files["File" + prop.Id];
if (fileFile == null) continue;
string pathFile = Server.MapPath("~/temp");
string filenameFile = Path.GetFileName(fileFile.FileName);
if (!string.IsNullOrEmpty(filenameFile)) {
fileFile.SaveAs(Path.Combine(pathFile, filenameFile));
ordinaryPropertyValue.Value = Path.Combine(pathFile, filenameFile);
instance.SetPropertyValue(prop.Id, ordinaryPropertyValue);
}
How can I rename files which are submiited from users?
just set file name you want in this line
this will save your file in path
~/temp/MyFile.ext