Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
vivek patel
1.7k
309
1.5k
After upload file has been corrupted in rood directory
Sep 9 2020 1:28 PM
When i upload the file in root directory and then try to open but getting error-it's look like this we don't support this file format
Please do suggestion as per below code
public
async Task<ReturnInfo> UploadImage(UploadProgressArgs files)
{
var test =
new
ReturnInfo();
var outputDirectory = Path.Combine(Environment.CurrentDirectory,
"TestFolder"
);
Directory.CreateDirectory(outputDirectory);
byte
[] dataArray =
new
byte
[files.Files.FirstOrDefault().Size];
var paths = Path.Combine(Environment.CurrentDirectory,
"TestFolder"
, files.Files.FirstOrDefault().Name);
using
(var stream =
new
FileStream(paths, FileMode.Create))
{
stream.Write(dataArray, 0, dataArray.Length);
}
}
Reply
Answers (
1
)
learning selenium test auto framework
Installing C# Software to friends pc's this Network/instance error