Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 6561 | Replies: 19
![]() |
•
•
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
Did you use the later code I posted? after davidcairns' post in which I added these two lines
I was getting the same result as you on my PC until I added those two lines, also I had to close down and restart IE so it didn't use the local cache (you know temporary internet files) and It works fine on my PC now.
asp Syntax (Toggle Plain Text)
Response.Addheader "ContentType", contentType Response.Addheader "Content-Disposition", "inline; filename=" & fileName
I was getting the same result as you on my PC until I added those two lines, also I had to close down and restart IE so it didn't use the local cache (you know temporary internet files) and It works fine on my PC now.
•
•
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
Join Date: Apr 2007
Location: california
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
hello everyone,
i must dislay a word document into a asp page.
i tried with iframe but it didn't work proprely so i need ur help.
I have this .doc document with some text into, and i have to display the document into my website, in a page written in ASP.
i tried with the code in this discuss but it work only like a download, but i wanna display the contenent of the page into the browser without manual download.
hope u can help me,
regards
i must dislay a word document into a asp page.
i tried with iframe but it didn't work proprely so i need ur help.
I have this .doc document with some text into, and i have to display the document into my website, in a page written in ASP.
i tried with the code in this discuss but it work only like a download, but i wanna display the contenent of the page into the browser without manual download.
hope u can help me,
regards
•
•
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
Try this code: Make changes to file name and location
<% @Language=VBScript %>
<%
Option Explicit
Dim fileName, filePath, contentType, objStream
fileName = "anish.doc"
filePath = "C:\" & fileName
contentType = "application/msword"
Response.Buffer = true
Response.Clear
Response.ContentType = contentType
'Response.CacheControl = "no-cache"
'issue for IE no-store doesn't work either
Response.Addheader "ContentType", contentType
Response.Addheader "Content-Disposition", "inline; filename=" & fileName
Set objStream = Server.CreateObject("ADODB.Stream")objStream.Open
objStream.Type = 1
objStream.LoadFromFile filePath
response.BinaryWrite objStream.Read
objStream.Close
Response.Flush
Response.End
%>
This code had already submitted by somebody. I hope this would help to rectify your problem. try this code and send feedback to this thread.
Try this code: Make changes to file name and location
<% @Language=VBScript %>
<%
Option Explicit
Dim fileName, filePath, contentType, objStream
fileName = "anish.doc"
filePath = "C:\" & fileName
contentType = "application/msword"
Response.Buffer = true
Response.Clear
Response.ContentType = contentType
'Response.CacheControl = "no-cache"
'issue for IE no-store doesn't work either
Response.Addheader "ContentType", contentType
Response.Addheader "Content-Disposition", "inline; filename=" & fileName
Set objStream = Server.CreateObject("ADODB.Stream")objStream.Open
objStream.Type = 1
objStream.LoadFromFile filePath
response.BinaryWrite objStream.Read
objStream.Close
Response.Flush
Response.End
%>
This code had already submitted by somebody. I hope this would help to rectify your problem. try this code and send feedback to this thread.
•
•
Join Date: Apr 2007
Location: california
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
it works but it isn't what i meant .
This code "asks" me to download or save the file like a normal link 4 the download does, but it isn't what i want.
I want a code that allows me to view a document into the browser and not a code like urs that i have to download before i can view it.
can u help me out??thanx so much
This code "asks" me to download or save the file like a normal link 4 the download does, but it isn't what i want.
I want a code that allows me to view a document into the browser and not a code like urs that i have to download before i can view it.
can u help me out??thanx so much
•
•
Join Date: Feb 2007
Location: London
Posts: 114
Reputation:
Rep Power: 2
Solved Threads: 8
2 things to note here
1. If you want to use MS Word integrated into the browser it will still depend to some extent on the users client settings, ie whether word is allowed to integrate with IE, Firefow, Opera or whatever they have. Even if you say inline on the disposition that doesn't mean the client is required to treat it that way.
2. If you actually want to display the contents in an HTML page then you may have to convert the word document to HTML or Text
1. If you want to use MS Word integrated into the browser it will still depend to some extent on the users client settings, ie whether word is allowed to integrate with IE, Firefow, Opera or whatever they have. Even if you say inline on the disposition that doesn't mean the client is required to treat it that way.
2. If you actually want to display the contents in an HTML page then you may have to convert the word document to HTML or Text
•
•
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation:
Rep Power: 0
Solved Threads: 0
furianera,
Please submit the full procedure that you have done in this business. I hope you don't have MSOffice installed on your computer. Go to internet explorer, click tools menu and internet option. Then go to Advanced Tab and click Reset Advanced settings.
------------------------------------------
1. You have to save the below mentioned code with the extension as .asp.
You have to edit the location specified in tht code, with your document name, and location.
And disposed it in your inetpub/wwwroot/ folder.
Type http://localhost/'filename.asp' at the address bar and press enter.
Because it is functioning properly in my computer.
------------------------------------------
2. Or if you want to make it as a text format, open the said document thorugh MS word, click file menu and select Save As Web page. That is all. And run it (Double click).
Good Luck
Please submit the full procedure that you have done in this business. I hope you don't have MSOffice installed on your computer. Go to internet explorer, click tools menu and internet option. Then go to Advanced Tab and click Reset Advanced settings.
------------------------------------------
1. You have to save the below mentioned code with the extension as .asp.
You have to edit the location specified in tht code, with your document name, and location.
And disposed it in your inetpub/wwwroot/ folder.
Type http://localhost/'filename.asp' at the address bar and press enter.
Because it is functioning properly in my computer.
------------------------------------------
2. Or if you want to make it as a text format, open the said document thorugh MS word, click file menu and select Save As Web page. That is all. And run it (Double click).
Good Luck
•
•
Join Date: Apr 2007
Location: california
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
HelloDear well in my laptop i've installed openoffice, and i have reset all the advanced options of IE.
i've just done all the things that u mean in the point 1, run the .asp file in my ie but my browser still asks me the download of the file and it doesn't open the document directly in the browser. so i don't understand your point.
Point 2:
i've just done also this way, but the results isn't good so i want the document (.doc) to be opened into the browser.
Today i tried this code:
but still works like a download..
i apologise for all the drawbacks
i've just done all the things that u mean in the point 1, run the .asp file in my ie but my browser still asks me the download of the file and it doesn't open the document directly in the browser. so i don't understand your point.
Point 2:
i've just done also this way, but the results isn't good so i want the document (.doc) to be opened into the browser.
Today i tried this code:
<% response.ContentType ="application/msword" %> <!--#include virtual="/myfile.doc" -->
i apologise for all the drawbacks
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode