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

Question about showing PDF file

Hi,
I have an urgent question about showing the PDF. I got the following
message:

Some files can harm your computer. If the file information below looks
suscipcious, or you do not fully trust the source, do not open or save this
file.
File name: XXX.pdf
....
Then i click open, i have error message again like below:
Internet Explorer cannot download XXX.pdf from ....

I can successfully run from the local machine, but from the application
machine i got above error message. The codes are exactly the same between
local machine and the application machine.

Really appreciate your help.
THX.
Nov 18 '05 #1
4 1532
> Some files can harm your computer. If the file information below looks
suscipcious, or you do not fully trust the source, do not open or save this file.
File name: XXX.pdf


2 thoughts:

1) Is your security on your browser set to some paranoid level?

2) Is maybe the live site sending a different mime type than your local
machine for PDF files?

-Darrel
Nov 18 '05 #2
Hi Green,

In addition to Darrel's suggestions, I think you can also check the
following things:
1. Is it ok to save the pdf , if we don't chose"open", but save it to
client disk?

2. The problem only occurs when you deploy the web application on that
application server? Will the problem reoccur if we visit that page from
some othe client machines?

3. AS Darrel has mentioned the live site's mime setting, I think you can
also compare the other settings between your local site and the applicaiotn
server's iis site setting. Maybe there're some thing different which may
cause the problem.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Nov 18 '05 #3
Have had the same problem months ago. Believe it has something to do with the
way you pass the pdf to the browser. Maybe an open door, but try the
following code:

// Create new reference to the report
Reports.myrep crReportDocument = new Reports.myrep();

//To PDF
System.IO.MemoryStream ReportStream =

(System.IO.MemoryStream)crReportDocument.ExportToS tream( ExportFormatType.PortableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(ReportStream.ToArray());
Response.End();
"Green" wrote:
Hi,
I have an urgent question about showing the PDF. I got the following
message:

Some files can harm your computer. If the file information below looks
suscipcious, or you do not fully trust the source, do not open or save this
file.
File name: XXX.pdf
....
Then i click open, i have error message again like below:
Internet Explorer cannot download XXX.pdf from ....

I can successfully run from the local machine, but from the application
machine i got above error message. The codes are exactly the same between
local machine and the application machine.

Really appreciate your help.
THX.

Nov 18 '05 #4
I came across a possible cause/resolution while researching a similar problem
with PDF documents. There is a documented problem using things like Excel or
Word with documents on the client. It also seems to affect PDF's. If the
virtual directory on an IIS server has "expire immediately" turned on for the
location of the PDF then a similar error will occur. A solution was to locate
the PDF in a directory in which the content expiration was something other
than "immediately".

"Green" wrote:
Hi,
I have an urgent question about showing the PDF. I got the following
message:

Some files can harm your computer. If the file information below looks
suscipcious, or you do not fully trust the source, do not open or save this
file.
File name: XXX.pdf
....
Then i click open, i have error message again like below:
Internet Explorer cannot download XXX.pdf from ....

I can successfully run from the local machine, but from the application
machine i got above error message. The codes are exactly the same between
local machine and the application machine.

Really appreciate your help.
THX.

Nov 18 '05 #5

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

Similar topics

4
by: Vishnu | last post by:
I have a strange problem on WindowsXP proffessional with IE6 ,when i try to display a tiff file ,it is not showing ,small red x is comming up. I tried by dowloading latest IE from microsoft but...
1
by: Sean W. Quinn | last post by:
Hey folks, I have a question regarding file handling, and the preservation of class structure. I have a class (and I will post snippets of code later in the post) with both primitive data...
5
by: dennis | last post by:
Hi, First of all, hi to you all. I'm working on a Delphi project wich is becoming near it's deadline. I have a very simple XSLT question wich i hope one of you folks can help me with? The...
2
by: koumides | last post by:
I am using an .mdb file that someone send me to make some changes. There are lots of forms, reports and tables inside the file. However I see lot of data in a form that doesn't come from the table...
8
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
8
by: NuB | last post by:
I'm passing in an array and I need to write them to a text file. I'm getting the data in fine but instead of writing it all to one file it generates a seperate file for each item. How can I put...
2
by: ME via .NET 247 | last post by:
I have a question about how System.Web.HttpPostedFile manages mime types using property ContentType in Windows. When I upload a known "text/plain" file with no extension the property doesnt...
3
by: Frank Kamjunke | last post by:
I want to make a little vb tool wich are actually looking for a file and this must be showing the file in this tool. Its a jpg or a bmp. Wich context must i use to load a external file in the...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.