TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
Thamsanqa Ngcongwane
NA
184
25.1k
How To Save Multiple Files
Oct 28 2019 7:35 AM
How to save multiple files at the same time.
I tried the following but its nit working.
IFormFile file = document.DocumentNameOne;
IFormFile file2 = document.DocumentNameTwo;
IFormFile file3 = document.DocumentNameThree;
var webRoot = _env.WebRootPath;
var path = Path.Combine(
Directory.GetCurrentDirectory(), webRoot +
"/Documents/"
,
file.FileName);
var pathTwo= Path.Combine(
Directory.GetCurrentDirectory(), webRoot +
"/Documents/"
,
file.FileName);
var pathThree = Path.Combine(
Directory.GetCurrentDirectory(), webRoot +
"/Documents/"
,
file.FileName);
using
(var stream =
new
FileStream(pathTwo, FileMode.Create))
{
file.CopyTo(stream);
stream.Close();
}
using
(var stream1 =
new
FileStream(pathThree, FileMode.Create))
{
stream1.Position = 0;
file2.CopyTo(stream1);
}
using
(var stream2 =
new
FileStream(path, FileMode.Create))
{
stream2.Position = 0;
file3.CopyTo(stream2);
}
Reply
Answers (
4
)
rewrite Datagridview Code to Datagrid
How to Display data from database on tabular format ?