Thursday, March 29, 2012
Office 2007 documents not appearing in iframe
office/pdf etc documents within an iframe in a web browser.
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within the
office program.
Does anyone know if there is a way to alter the behaviour of office 2007 so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
ThanksAFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
Another option could be to use an object tag (not tried)...
Patrice
"T" <T@.discussions.microsoft.com> a crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
> We've been developing an application for a while which allows display of
> office/pdf etc documents within an iframe in a web browser.
> However, since installing office 2007 this has stopped working and instead
> of them appearing nicely in the iframe they now pop up and appear within
> the
> office program.
> Does anyone know if there is a way to alter the behaviour of office 2007
> so
> that the documents remain embedded within the iframe, or is this something
> which I just have to accept.
> Thanks
>
Hey thanks. I did as suggested in the support article and it does now open i
n
the iframe.
However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know wh
y
this was done? Also its not something i can expect all our users to do after
they install office 2007, that they then have to for every office file type
select a check box in folder options to allow them to appear in the browser.
Does anyone have any suggestions?
Cheers
"Patrice" wrote:
> AFAIK in both 2007 and previous version this is actually a client dependan
t
> behavior. Try :
> http://support.microsoft.com/kb/162059/en-us
> Another option could be to use an object tag (not tried)...
> --
> Patrice
>
> "T" <T@.discussions.microsoft.com> a écrit dans le message de news:
> 49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
>
>
re:
!> http://support.microsoft.com/kb/162059/en-us
That KB needs revision.
The latest document type listed is Office 8.
Office 2007 is Office 12.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Patrice" <http://www.chez.com/scribe/> wrote in message
news:OKO8sV9XHHA.4552@.TK2MSFTNGP05.phx.gbl...
> AFAIK in both 2007 and previous version this is actually a client dependan
t behavior. Try :
> http://support.microsoft.com/kb/162059/en-us
> Another option could be to use an object tag (not tried)...
> --
> Patrice
>
> "T" <T@.discussions.microsoft.com> a crit dans le message de news:
> 49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
>
I mentionned you could perhaps use an object tag inside your iframe to see
if the document is then forced to be placed inside the IE window...
"T" <T@.discussions.microsoft.com> a crit dans le message de news:
AA9DF605-996F-457E-95C0-A9FE2983D49D@.microsoft.com...
> Hey thanks. I did as suggested in the support article and it does now open
> in
> the iframe.
> However, this must have been something the Office 2007 installation messed
> around with as everything worked fine before installing 2007. Anyone know
> why
> this was done? Also its not something i can expect all our users to do
> after
> they install office 2007, that they then have to for every office file
> type
> select a check box in folder options to allow them to appear in the
> browser.
> Does anyone have any suggestions?
> Cheers
>
> "Patrice" wrote:
>
Office 2007 documents to database, dynamically generate on demand
Hello, I am currently adding some document management functionality to a .Net 2.0 Web app (VB) where I take a file in, save the file to a SQL 2000 database (image datatype), and then allow users to browse and download these files.
This works great for most files my users use -- with the exception of Office 2k7 files
I am able to upload a file, read the file into a binary array and insert into a new record in the database.
However, when I retrieve the binary array and attempt to output the file, there is a problem.
The user is prompted to open or save the file per-usual, however when Word 2007 tries to open the file, there is an error message that says:
"The Office Open XML file Test.docx cannot be opened because there are problems with the contents"
Under "Details" it says:
"The file is corrupt and cannot be opened"
If I click "OK", I am asked whether I want to have Word recover the contents of the document.
If I click "Yes" my document opens and all of the original content is there.
I have been doing some reading, and I know that the new Office 2007 files are really .zip files with XML files that contain formatting and content information.
What I would like to know is, is there a reason why I can't save these files to the database as I have been, and if so, is there a "right" way to do this?
Hi,
Based on my understanding, the users upload the word 2007 files into database and download them with your asp.net application. When you try to open the file that is downloaded, you get the error message above. If I have misunderstood you, please feel free to let me know.
To better understand your issue, could you please confirm the following information:
When we write the file to the client, we should make sure that file doesn't contain HTML-tag. We can add Response.End() right after writing and stop further processing of the ASP.NET page. For more information, seehttp://blog.benday.com/archive/2005/08/09/2705.aspx.
Yes, you have summarized what I am doing correctly.
I have been looking into this in more detail, and after using Hex Workshop, I compared the original file and the streamed file. The streamed file contained 1 extra byte.
I reviewed my code and found that the size of the file in the database was the same as the original, so I reviewed my code in the download.aspx code-behind (the file that streams the requested document).
I had read about this earlier, so I knew not to have any HTML in the aspx.
However, it seems that the Content-Length of the file is zero-based, so when I was setting Content-Length to equal the value I had in the database, an extra byte was being added.
When I set Content-Length to equal the size of the file (in bytes) - 1, I no longer received the error.
Ex:
Dim File As New EO.Library.File(CInt(Request("file")))
Dim _BinaryLength = (CInt(File.Binary.Length) - 1)
Response.Clear()
Response.Buffer = True
Response.AddHeader("Content-Disposition", "attachment;filename=" & File.Name)
Response.AddHeader("Content-Length", CInt(_BinaryLength))
Response.ContentType = File.ContentType
Response.BinaryWrite(File.Binary)
Response.End()
Office 2007 documents not appearing in iframe
office/pdf etc documents within an iframe in a web browser.
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within the
office program.
Does anyone know if there is a way to alter the behaviour of office 2007 so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
ThanksAFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
Another option could be to use an object tag (not tried)...
--
Patrice
"T" <T@.discussions.microsoft.coma crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
Quote:
Originally Posted by
We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.
>
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within
the
office program.
>
Does anyone know if there is a way to alter the behaviour of office 2007
so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
>
Thanks
>
Hey thanks. I did as suggested in the support article and it does now open in
the iframe.
However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know why
this was done? Also its not something i can expect all our users to do after
they install office 2007, that they then have to for every office file type
select a check box in folder options to allow them to appear in the browser.
Does anyone have any suggestions?
Cheers
"Patrice" wrote:
Quote:
Originally Posted by
AFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
>
Another option could be to use an object tag (not tried)...
>
--
Patrice
>
>
>
"T" <T@.discussions.microsoft.coma écrit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
Quote:
Originally Posted by
We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within
the
office program.
Does anyone know if there is a way to alter the behaviour of office 2007
so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
Thanks
>
>
>
re:
!http://support.microsoft.com/kb/162059/en-us
That KB needs revision.
The latest document type listed is Office 8.
Office 2007 is Office 12.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Patrice" <http://www.chez.com/scribe/wrote in message
news:OKO8sV9XHHA.4552@.TK2MSFTNGP05.phx.gbl...
Quote:
Originally Posted by
AFAIK in both 2007 and previous version this is actually a client dependant behavior. Try :
http://support.microsoft.com/kb/162059/en-us
>
Another option could be to use an object tag (not tried)...
>
--
Patrice
>
>
>
"T" <T@.discussions.microsoft.coma crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
Quote:
Originally Posted by
>We've been developing an application for a while which allows display of
>office/pdf etc documents within an iframe in a web browser.
>>
>However, since installing office 2007 this has stopped working and instead
>of them appearing nicely in the iframe they now pop up and appear within the
>office program.
>>
>Does anyone know if there is a way to alter the behaviour of office 2007 so
>that the documents remain embedded within the iframe, or is this something
>which I just have to accept.
>>
>Thanks
>>
>
>
I mentionned you could perhaps use an object tag inside your iframe to see
if the document is then forced to be placed inside the IE window...
"T" <T@.discussions.microsoft.coma crit dans le message de news:
AA9DF605-996F-457E-95C0-A9FE2983D49D@.microsoft.com...
Quote:
Originally Posted by
Hey thanks. I did as suggested in the support article and it does now open
in
the iframe.
>
However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know
why
this was done? Also its not something i can expect all our users to do
after
they install office 2007, that they then have to for every office file
type
select a check box in folder options to allow them to appear in the
browser.
>
Does anyone have any suggestions?
>
Cheers
>
>
>
"Patrice" wrote:
>
Quote:
Originally Posted by
>AFAIK in both 2007 and previous version this is actually a client
>dependant
>behavior. Try :
>http://support.microsoft.com/kb/162059/en-us
>>
>Another option could be to use an object tag (not tried)...
>>
>--
>Patrice
>>
>>
>>
>"T" <T@.discussions.microsoft.coma crit dans le message de news:
>49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
Quote:
Originally Posted by
We've been developing an application for a while which allows display
of
office/pdf etc documents within an iframe in a web browser.
>
However, since installing office 2007 this has stopped working and
instead
of them appearing nicely in the iframe they now pop up and appear
within
the
office program.
>
Does anyone know if there is a way to alter the behaviour of office
2007
so
that the documents remain embedded within the iframe, or is this
something
which I just have to accept.
>
Thanks
>
>>
>>
>>