Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
how to send filepath empty to server using filestream IN C#
Shefali Lahariya
Dec 22 2017 1:58 AM
110
Reply
Using code this:
but getting error in "
FileStream fs = File.OpenRead(filePath);" /// because file path is empty. so how to call add empty path in form (MultipartFormDataContent).
MultipartFormDataContent form = new MultipartFormDataContent();
FileStream fs = File.OpenRead(filePath);
var streamContent = new StreamContent(fs);
var imageContent = new ByteArrayContent(streamContent.ReadAsByteArrayAsync().Result);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(jioMeetConstant.tokentype, " " + jioMeetConstant.Accesstoken);
form.Add(new StringContent(grp_name), "grpName");
form.Add(new StringContent(member), "memberList");
form.Add(imageContent, "grpIcon", Path.GetFileName(filePath));
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
System.Drawing - Parameter is not valid
is it possible to get word as a control in winforms