TekiSreelakshmi
asked on
Open Sharepoint server's pdf file in asp.net...
Hi,
Want to Open a pdf file in asp.net which is in the sharepoint server..
I 've used the code below...
System.Net.WebClient client = new System.Net.WebClient();
string path = "http://hawaii:9999/Functions/HumanResource/HR/Employee%20Handbook/GE%20Emp%20Handbook.pdf";
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("conten t-length", buffer.Length.ToString());
Response.BinaryWrite(buffe r);
}
Then its giving exception like
The remote server returned an error: (401) Unauthorized.
what to do to solve this problem..
Want to Open a pdf file in asp.net which is in the sharepoint server..
I 've used the code below...
System.Net.WebClient client = new System.Net.WebClient();
string path = "http://hawaii:9999/Functions/HumanResource/HR/Employee%20Handbook/GE%20Emp%20Handbook.pdf";
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("conten
Response.BinaryWrite(buffe
}
Then its giving exception like
The remote server returned an error: (401) Unauthorized.
what to do to solve this problem..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just forgot to mention, you need to download the file first and when its done then you can stream it out from your asp.net application.