mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
Fix upload bug with files.
This commit is contained in:
parent
a7a111e4ec
commit
78a672ed69
1 changed files with 4 additions and 4 deletions
|
@ -87,7 +87,7 @@ public ActionResult AddRelease(PostDownloadViewModel model)
|
|||
if (!Directory.Exists(mapped_dir))
|
||||
Directory.CreateDirectory(mapped_dir);
|
||||
|
||||
string file_name_d = model.Download.FileName;
|
||||
string file_name_d = model.Download.FileName.ToLower();
|
||||
foreach(var c in file_name_d.ToCharArray())
|
||||
{
|
||||
if (!ApprovedIdChars.Contains(c))
|
||||
|
@ -95,7 +95,7 @@ public ActionResult AddRelease(PostDownloadViewModel model)
|
|||
}
|
||||
download_dir += file_name_d;
|
||||
mapped_dir = Server.MapPath(download_dir);
|
||||
download.DownloadUrl = download_dir;
|
||||
download.DownloadUrl = download_dir.Remove(0, 1);
|
||||
//Now the download is saved in the DB. Let's get it on the server.
|
||||
model.Download.SaveAs(mapped_dir);
|
||||
|
||||
|
@ -104,7 +104,7 @@ public ActionResult AddRelease(PostDownloadViewModel model)
|
|||
if (!Directory.Exists(mapped_dir))
|
||||
Directory.CreateDirectory(mapped_dir);
|
||||
|
||||
file_name_d = model.Screenshot.FileName;
|
||||
file_name_d = model.Screenshot.FileName.ToLower(); ;
|
||||
foreach (var c in file_name_d.ToCharArray())
|
||||
{
|
||||
if (!ApprovedIdChars.Contains(c))
|
||||
|
@ -112,7 +112,7 @@ public ActionResult AddRelease(PostDownloadViewModel model)
|
|||
}
|
||||
download_dir += file_name_d;
|
||||
mapped_dir = Server.MapPath(download_dir);
|
||||
download.ScreenshotUrl = download_dir;
|
||||
download.ScreenshotUrl = download_dir.Remove(0,1);
|
||||
model.Screenshot.SaveAs(mapped_dir);
|
||||
|
||||
//Now we just save to the database...
|
||||
|
|
Loading…
Reference in a new issue