Uvoz, ce je vec projektov da je scroll bar

This commit is contained in:
2026-02-03 19:07:52 +01:00
parent 980d3ff161
commit 7d64e423c3
14 changed files with 213 additions and 173 deletions

View File

@@ -104,21 +104,26 @@ namespace EveryThing.Pages.Projects
{
return Page();//TODO return error
}
string path = Path.Combine(_hostingEnvironment.WebRootPath, "Uploads");
var path = Path.Combine(_hostingEnvironment.WebRootPath, "Uploads", "TempExcelImport");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
List<string> uploadedFiles = new List<string>();
else
{
//Pocistimo mapo
foreach (var fileInfo in new DirectoryInfo(path).GetFiles("*.*"))
{
fileInfo.Delete();
}
}
var postedFile = postedFiles[0];
string fileName = Guid.NewGuid().ToString().Replace("-", "_") + Path.GetExtension(postedFile.FileName);
using (FileStream stream = new FileStream(Path.Combine(path, fileName), FileMode.Create))
var fileName = postedFile.FileName;//Guid.NewGuid().ToString().Replace("-", "_") + Path.GetExtension(postedFile.FileName);
await using (var stream = new FileStream(Path.Combine(path, fileName), FileMode.Create))
{
postedFile.CopyTo(stream);
uploadedFiles.Add(fileName);
await postedFile.CopyToAsync(stream);
}
return RedirectToPage("./CreatePartItemImportExcel", new { idProject = idProject, idProjectPart = idProjectPart, fileName = fileName});
}