Uvoz, ce je vec projektov da je scroll bar
This commit is contained in:
@@ -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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user