473,385 Members | 1,867 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,385 software developers and data experts.

Displaying PDF file on ASP.net Page

using VB.net (VB 2005) ASP.net 2.0 on windows 2003 server

Dim strPDFFilePath AS string = "\\webserverhostname\d$\foldername
\filename"

the following code is diving me an error saying access denied

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "Application/PDF"
Response.WriteFile(strPDFFilePath)
Response.Flush()
Response.Close()
Response.End()

Account under which ASP.net is running have read, browser access to d:
drive and the folder in which file resides.

I guess it has something to do with drive name in the path?

Is there a way you can use Server.Mappath to map a different drive
(website is hosted on c: and file is on a different drive d: on the
same server)?

Jun 7 '07 #1
3 1418
AFAIK $ shares access is only allowed to administrative accounts. I would
create my own application specific share (remember you have also to apply
the appropriate rights to the share plus it's likely better to avoid sharing
the drive root).

---
Patrice
"c_shah" <sh*********@netzero.neta écrit dans le message de news:
11*********************@k79g2000hse.googlegroups.c om...
using VB.net (VB 2005) ASP.net 2.0 on windows 2003 server

Dim strPDFFilePath AS string = "\\webserverhostname\d$\foldername
\filename"

the following code is diving me an error saying access denied

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "Application/PDF"
Response.WriteFile(strPDFFilePath)
Response.Flush()
Response.Close()
Response.End()

Account under which ASP.net is running have read, browser access to d:
drive and the folder in which file resides.

I guess it has something to do with drive name in the path?

Is there a way you can use Server.Mappath to map a different drive
(website is hosted on c: and file is on a different drive d: on the
same server)?

Jun 7 '07 #2
Oups. I saw by reading again that files are actually on drive d: on the
*same*machine . You could perhaps just use the drive letter ie.
d:\MyWebApps\ThisWebApp\TheFileWant.pdf ? and use a config setting to point
to the root location for this application files...

--
Patrice
"Patrice" <http://www.chez.com/scribe/a écrit dans le message de news:
Og**************@TK2MSFTNGP04.phx.gbl...
AFAIK $ shares access is only allowed to administrative accounts. I would
create my own application specific share (remember you have also to apply
the appropriate rights to the share plus it's likely better to avoid
sharing the drive root).

---
Patrice
"c_shah" <sh*********@netzero.neta écrit dans le message de news:
11*********************@k79g2000hse.googlegroups.c om...
>using VB.net (VB 2005) ASP.net 2.0 on windows 2003 server

Dim strPDFFilePath AS string = "\\webserverhostname\d$\foldername
\filename"

the following code is diving me an error saying access denied

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "Application/PDF"
Response.WriteFile(strPDFFilePath)
Response.Flush()
Response.Close()
Response.End()

Account under which ASP.net is running have read, browser access to d:
drive and the folder in which file resides.

I guess it has something to do with drive name in the path?

Is there a way you can use Server.Mappath to map a different drive
(website is hosted on c: and file is on a different drive d: on the
same server)?


Jun 7 '07 #3
thanks
Jun 7 '07 #4

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

Similar topics

2
by: Paul M | last post by:
Hi there, i hope someone can help me out here.. I have a input screen where i want the user to enter text in 2 different languages, english and macedonian. How is it possible to make the...
1
by: Waguih Boctor | last post by:
Hi, I have a number of ASP pages where some JPGs and GIFs are displaying in the browser and some are not. I have included an excerpt from the HTML below. In this example, the gif file at the...
1
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for...
2
by: Carole MacDonald | last post by:
There have been lots of posts on this topic, but I haven't been able to apply any of the suggestions to my situation. I have an .aspx page with a form on it that has several submit buttons on...
5
by: Tomaz Koritnik | last post by:
Hi I have many short HTML files stored in a binary stream storage to display descriptions for various items in application. HTML would be display inside application using some .NET control or...
0
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
2
by: johnb41 | last post by:
In my app, I need to open up a multipage tiff file, and also display it's thumbnail images IN HIGH QUALITY. (High Quality meaning anti-aliased, and looking good; not rough and pixely) The...
15
by: Kevin Hanken | last post by:
Hi, Pretty much a newbie to aspnet and xp -- I am using XP Pro, Service Pack 2. I installed IIS, set up a virtual directory, created an aspx file and pasted in a little code from the w3schools...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.