How to record files on a server with minimal access using MVC. The next version of the code is not suitable as it will be clogging up the domain.
Controller code:
var fileFile = Request.Files["p" + prop.Id];
if (fileFile == null) continue;
string pathFile = AppDomain.CurrentDomain.BaseDirectory + "UploadedFiles";
string filenameFile = Path.GetFileName(fileFile.FileName);
if (filenameFile != null) fileFile.SaveAs(Path.Combine(pathFile, filenameFile));
(if it is possible to realize this by putting file to the cache)
EDITED CODE:
var ordinaryPropertyValue = new Catalog.Core.Entities.OrdinaryPropertyValue();
Environment.CurrentDirectory = Environment.GetEnvironmentVariable("TEMP");
var fileFile = Request.Files["File" + prop.Id]; if (fileFile == null) continue;
string pathFile = Environment.CurrentDirectory;
fileFile.SaveAs(pathFile);
ordinaryPropertyValue.Value = pathFile;
instance.SetPropertyValue(prop.Id, ordinaryPropertyValue);