Thursday, March 22, 2012

Why the .pdf can not be shown?

Hello, friends,
I developed a web page with the following statement as part of it:
<td width="80%" height="800" valign="top">
<iframe width="100%" height="100%"
src="c:\DeptFiles\shs_test.pdf"></iframe>
</td>
It worked fine in dev machine (in a local network).
However, after deploying it to the server and running it on server IE, to my
surprise, this <td></td> cell was blank!
I then run it through internet, I got a message saying "Action Cancelled:
Internet Explorer was unable to link to the Web page you requested. The page
might be temporarily unavailable.", I could not even see the rest of the web
page.
Any ideas? Help please! Thanks a lot.
(I thought it could be IE security setting issue, but not sure and not to
know how/why)The problem is :
src="c:\DeptFiles\shs_test.pdf"></iframe>
Try using a valid virtual path for the file.
i.e., for example :
src="/somevirtualdirectory/shs_test.pdf"></iframe>
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:79EB9987-9DCA-4C46-9A24-DE39CAF55DFA@.microsoft.com...
> Hello, friends,
> I developed a web page with the following statement as part of it:
> <td width="80%" height="800" valign="top">
> <iframe width="100%" height="100%"
> src="http://pics.10026.com/?src=c:\DeptFiles\shs_test.pdf"></iframe>
> </td>
> It worked fine in dev machine (in a local network).
> However, after deploying it to the server and running it on server IE, to
my
> surprise, this <td></td> cell was blank!
> I then run it through internet, I got a message saying "Action Cancelled:
> Internet Explorer was unable to link to the Web page you requested. The pa
ge
> might be temporarily unavailable.", I could not even see the rest of the w
eb
> page.
> Any ideas? Help please! Thanks a lot.
> (I thought it could be IE security setting issue, but not sure and not to
> know how/why)
But, why it worked in my dev machine?
Also, since we have a lot of files (GBs), it is not good to put all of them
under c:\inetpub\wwwroot\. Rather, we want to put them in a separate
directory, or another drive, or even another file server in a local network.
Then, what is the best way to specify virtual path? Noramlly, how people
handle such kinds of questions? Thanks.
"Juan T. Llibre" wrote:

> The problem is :
> src="http://pics.10026.com/?src=c:\DeptFiles\shs_test.pdf"></iframe>
> Try using a valid virtual path for the file.
> i.e., for example :
> src="http://pics.10026.com/?src=/somevirtualdirectory/shs_test.pdf"></iframe>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espa?ol : http://asp.net.do/foros/
> ===================================
> "Andrew" <Andrew@.discussions.microsoft.com> wrote in message
> news:79EB9987-9DCA-4C46-9A24-DE39CAF55DFA@.microsoft.com...
>
>
re:
> But, why it worked in my dev machine?
Because local paths work in a local dev machine.
If the local path is in the same machine as the server, that works.
If the file is in a different machine than the server, it fails.
A client will look in its own file system
for the file if you specify a local path.
re:
> Also, since we have a lot of files (GBs), it is not good to put all of the
m
> under c:\inetpub\wwwroot\. Rather, we want to put them in a separate
> directory
You could put them all in a shared virtual directory, or even under one virt
ual
directory with subdirectories below it, to classify the files by subject/iss
ue.
re:
> or another drive, or even another file server in a local network
You can do that, as long as they're accessible via a standard URL.
re:
> Then, what is the best way to specify virtual path?
A relative URL, i.e. :
"/somedirectory/somefile.ext"
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:4A9ADEDE-0146-42C2-A695-793387039DAD@.microsoft.com...
> But, why it worked in my dev machine?
> Also, since we have a lot of files (GBs), it is not good to put all of the
m
> under c:\inetpub\wwwroot\. Rather, we want to put them in a separate
> directory, or another drive, or even another file server in a local networ
k.
> Then, what is the best way to specify virtual path? Noramlly, how people
> handle such kinds of questions? Thanks.
> "Juan T. Llibre" wrote:
>
Because your IE was able to find that PDF file using local path
"c:\DeptFiles\shs_test.pdf", was (finding a file) is imposible when server i
s
on different machine.
Try creating a wirtual directory under catalog of your application in IIS
management console. This virtual directory can point to a catalog on
different drive.
Przemo
"Andrew" wrote:
> But, why it worked in my dev machine?
> Also, since we have a lot of files (GBs), it is not good to put all of the
m
> under c:\inetpub\wwwroot\. Rather, we want to put them in a separate
> directory, or another drive, or even another file server in a local networ
k.
> Then, what is the best way to specify virtual path? Noramlly, how people
> handle such kinds of questions? Thanks.
> "Juan T. Llibre" wrote:
>
Is this file placed on all machines and you wan't to access the local copy
from the web site ?
AFAIK it's likely no more allowed with the default settings for safety
reasons (a web site can't reference local content any more with SP2).
Patrice
"Andrew" <Andrew@.discussions.microsoft.com> a crit dans le message de
news:79EB9987-9DCA-4C46-9A24-DE39CAF55DFA@.microsoft.com...
> Hello, friends,
> I developed a web page with the following statement as part of it:
> <td width="80%" height="800" valign="top">
> <iframe width="100%" height="100%"
> src="http://pics.10026.com/?src=c:\DeptFiles\shs_test.pdf"></iframe>
> </td>
> It worked fine in dev machine (in a local network).
> However, after deploying it to the server and running it on server IE, to
my
> surprise, this <td></td> cell was blank!
> I then run it through internet, I got a message saying "Action Cancelled:
> Internet Explorer was unable to link to the Web page you requested. The
page
> might be temporarily unavailable.", I could not even see the rest of the
web
> page.
> Any ideas? Help please! Thanks a lot.
> (I thought it could be IE security setting issue, but not sure and not to
> know how/why)
because localhost is a trusted domain, and allows access to c:\ thru a url
-- bruce (sqlwork.com)
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:4A9ADEDE-0146-42C2-A695-793387039DAD@.microsoft.com...
> But, why it worked in my dev machine?
> Also, since we have a lot of files (GBs), it is not good to put all of
> them
> under c:\inetpub\wwwroot\. Rather, we want to put them in a separate
> directory, or another drive, or even another file server in a local
> network.
> Then, what is the best way to specify virtual path? Noramlly, how people
> handle such kinds of questions? Thanks.
> "Juan T. Llibre" wrote:
>

0 comments:

Post a Comment