PC Review


Reply
Thread Tools Rate Thread

Displaying PDF file on ASP.net Page

 
 
c_shah
Guest
Posts: n/a
 
      7th Jun 2007
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)?

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      7th Jun 2007
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" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> 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)?
>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      7th Jun 2007
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:
(E-Mail Removed)...
> 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" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed)...
>> 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)?
>>

>
>



 
Reply With Quote
 
c_shah
Guest
Posts: n/a
 
      7th Jun 2007
thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Dynamic Controls and Displaying Page by Page on the form =?Utf-8?B?QmlsIE11aA==?= Microsoft VC .NET 8 10th Feb 2008 10:27 AM
Create Dynamic Controls and Displaying Page by Page on the form =?Utf-8?B?QmlsIE11aA==?= Microsoft Dot NET 8 10th Feb 2008 10:27 AM
aspx page not displaying until move moved on page agricfowl@googlemail.com Microsoft ASP .NET 2 27th Nov 2006 07:50 PM
displaying a pdf file in a .net page sanjeet1@hotmail.com Microsoft Dot NET Framework 1 28th Sep 2005 12:53 AM
Displaying File name on a fetcher page Rukmal Fernando Microsoft ASP .NET 1 25th Jun 2004 09:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:50 PM.