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
Ankit Agarwal
NA
379
252.8k
How to get files from https server using C# .NET?
Jun 30 2020 2:55 AM
Hello,
How to Get Files from Http Server using c# .net?
I want to get files from web server using c# .net.
f.XMarksSheetName etc. my file name and files already stored in suppose my path is
"https://abc.com/images/Upload/" path.
Its getting error:- The remote server returned an error: (404) Not Found.
Please help me.
I have tried:-
public
void
ExportImages(List
fd)
{
foreach
(var f
in
fd)
{
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(
"https://abc.com/images/Upload/"
+ f.XMarksSheetName +
","
+ f.XCertificateName +
","
+ f.XIIMarksSheetName +
","
+
","
+ f.XIICertificateName +
","
+ f.GMarksSheetName +
","
+ f.GCertificateName +
","
+ f.FileName +
","
+ f.FileNameNationalId +
","
+ f.FileNamePassport);
httpRequest.Method = WebRequestMethods.Http.Get;
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
//Stream httpResponseStream = httpResponse.GetResponseStream();
StreamReader sr =
new
StreamReader(httpResponse.GetResponseStream());
var results = sr.ReadToEnd();
sr.Close();
}
}
Thanks in Advance.
Ankit Agarwal
Software Engineer
Reply
Answers (
1
)
How two different projects, two different language one solution
DataGridview automatically