Problem displaying pdf to a web page

E

Efrain Flores

Hi:

I recently found a problem while trying to display a pdf document on an aspx
webpage. Here is the code that I am using:

With Response

. ClearHeaders()

.Clear()

.Buffer = True

.ContentType = "application/pdf"

If pfForceDownloadDlg Then .AppendHeader("Content-Disposition",
"inline;filename=" & ptFileName)

.WriteFile(ptPath & ptFileName)

.Flush()

.End()

End With



I have verified that the pdf document was generated prior calling this
routine. Is it possible that the folder permissions are affecting the
outcome of the page?

I will appreciate all the help you can give me on this matter.
 
S

Steve C. Orr [MVP, MCSD]

Yes, there is a very good chance it is a permissions issue.
To test this theory, you can use impersonation to have ASP.NET temporarily
run under your account, since you know you have access to the file.

For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyUserName">
password="password"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top