fixed the bork

This commit is contained in:
limited_dev 2023-02-07 21:47:28 +01:00
parent 2724b6b9d2
commit c1fd893ff0
10 changed files with 20 additions and 15 deletions

View file

@ -100,7 +100,7 @@
{
Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 4); // max 2MB
var file = Path.GetRandomFileName() + "." + selectedFile.Name.Split(".")[selectedFile.Name.Split(".").Length - 1];
var path = $"{env.WebRootPath}/img/dynamic/comment/{@post.Board}/{file}";
var path = $"{env.WebRootPath}/img/dynamic/comment/{@post.Board}/{@file}";
FileStream fs = File.Create(path);
await stream.CopyToAsync(fs);
stream.Close();
@ -110,7 +110,7 @@
var imageToUpload = new ImageData
{
Board = post.Board,
ImageLocation = $"/img/dynamic/comment/{post.Board}/{file}"
ImageLocation = $"/img/dynamic/comment/{@post.Board}/{@file}"
};
int imageID = await ImagesRepository.createImageAsync(imageToUpload);
commentToCreate = new CommentData()

View file

@ -120,7 +120,7 @@
Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 4); // max 2MB
var file = Path.GetRandomFileName() + "." + selectedFile.Name.Split(".")[selectedFile.Name.Split(".").Length - 1];
var path = $"{env.WebRootPath}/img/dynamic/op/{board.Tag}/{file}";
var path = $"{env.WebRootPath}/img/dynamic/op/{@board.Tag}/{@file}";
FileStream fs = File.Create(path);
await stream.CopyToAsync(fs);
stream.Close();
@ -129,7 +129,7 @@
var imageToUpload = new ImageData
{
Board = board.Tag,
ImageLocation = $"/img/dynamic/op/{board.Tag}/{file}"
ImageLocation = $"/img/dynamic/op/{@board.Tag}/{@file}"
};
int imageID = await ImagesRepository.createImageAsync(imageToUpload);
var postToPost = new PostData