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
Pinku
1.5k
300
45.1k
Index (zero based) must be greater than or equal to zero
Nov 6 2019 11:33 PM
try
{
MXResumeWordDoc resumeWordDoc = new MXResumeWordDoc();
var IsResumeLoaded = resumeWordDoc.LoadResumeWordDocByDID(neo as Neo, applicationID);
if (IsResumeLoaded)
{
string fileExtension = System.IO.Path.GetExtension(resumeWordDoc.Elements.FileName.Value).ToLower();
string fileName = System.IO.Path.GetFileName(resumeWordDoc.Elements.FileName.Value).ToLower();
MemoryStream stream= new MemoryStream();
HttpResponse response1 = HttpContext.Current.Response;
response1.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}.doc\""));
using (FileStream fs = new FileStream(fileName, FileMode.Create, System.IO.FileAccess.Write))
{
stream.WriteTo(fs);
}
response1.Flush();
response1.End();
}
response.Results.Add("response1");
}
catch (Exception ex)
{
neo.SendInformationalMXM("ResumeService", ex.Message, ex, this, "ResumeService.GetResume");
throw ex;
}
return response;
This code throwing Index (zero based) must be greater than or equal to zero and less than the size of the argument list. exception from the below line
response1.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}.doc\""));
How to fix it?
Reply
Answers (
1
)
How to create download option in api with csharp
how to transfer from one sever to another in webapplication