473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Problem displaying pdf to a web page

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.
Nov 19 '05 #1
1 1207
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/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Efrain Flores" <ef*****@rocketmail.com> wrote in message
news:uY**************@TK2MSFTNGP09.phx.gbl...
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.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ramesh | last post by:
hi, My C# application displaying correctly in IE, But in netscape all input controls (text box, dblist, drop down list and etc.,) disappered. Only lables are displaying. The value inside the drop...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
1
by: Simon Harvey | last post by:
Hi, I'm hoping someone can help me witht he following problem: I have a fairly simple page that has a sort form and a button for adding the forms details to an arraylist. When the button is...
0
by: Eyal Zinder | last post by:
Hello to all.. I'm trying to format an excel page by creating html tables on the fly through Response.ContentType = "application/vnd.ms-excel" . I now produce reports in html format by processing...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
4
by: MrL8Knight | last post by:
Hello, I am trying to build a simple php form based shopping cart using a cookie with arrays. I need to use 1 cookie because each order will have over 20 items. With that said, I realize I need to...
12
by: Patxi | last post by:
This is the first time I try to use cookies, and despite of reading some tutotials, I'm have real trouble to make it work correctly. My cookie reading code is in Master Page. When I click on a...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
1
by: bhappy | last post by:
Hi All, I am generating a report using crystal reports formula fields and parameter fields, In report im getting all data but not in proper way, ie In 1st page --------Its displaying blank page...
1
by: Maanav Jackson | last post by:
Hi I am displaying a third party webpage into a variable using curl library. When i am displaying the variable in the browser using echo command as shown below. echo $pagecopy; Browser is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.