I just want to upload a file. But now I can only upload images.
I have it:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult DownloadFile(DownloadFileModel model, string fileName, int fileId)
{
string customerSchema = SfsHelpers.StateHelper.GetSchema();
TemplateLibraryEntry entry = GetTemplateLibraryEntry(model.DesignId, customerSchema);
FileTree tree = CreateTree(model.DesignId, entry.FilePath);
FileInfo fileInfo = new FileInfo(tree.Files[fileId].FullPath);
DirectoryInfo directoryInfo = new DirectoryInfo(tree.Files[fileId].FullPath);
try {
var fs = System.IO.File.OpenRead(fileInfo + model.FileName );
return File(fs, "application/jpg", fileName);
}
catch {
throw new HttpException(404, "Couldn't find " + model.FileName);
}
}
But if I upload the file now, I see the download file every time. I mean, I do not see the file name and extensie
Thank you
source
share