Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Displaying PDF file on ASP.net Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
c_shah - 07 Jun 2007 17:03 GMT
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)?
Patrice - 07 Jun 2007 17:31 GMT
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

> using VB.net (VB 2005) ASP.net 2.0 on windows 2003 server
>
[quoted text clipped - 19 lines]
> (website is hosted on c: and file is on a different drive d: on the
> same server)?
Patrice - 07 Jun 2007 17:47 GMT
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

> AFAIK $ shares access is only allowed to administrative accounts. I would
> create my own application specific share (remember you have also to apply
[quoted text clipped - 27 lines]
>> (website is hosted on c: and file is on a different drive d: on the
>> same server)?
c_shah - 07 Jun 2007 22:02 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.