472,799 Members | 1,296 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 software developers and data experts.

Setting NoCache causes IE/Powerpoint to fail to open

Hi,

For the last couple of releases of a product we're developing we've been
running to very wierd behavior from IE and our ASP.NET web application which
serves up various types of files and I'm getting very frustrated in trying
to solve it!

We content we are serving up is potentially sensitive and therefore we DO
NOT want it cached on the remote client (IE) beyond the lifetime of the
application rendering it (IE, Powerpoint, Word etc.). Clearly the user can
mess this up but thats another issue.

So on the request for a file we set:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

- or -

Response.Cache.SetNoStore();
Response.Cache.SetNoServerCaching();

The rest of the headers get set pretty much as you'd expect:
Response.StatusCode=200;
Response.ContentType = fileContentType;
Response.AppendHeader("Content-Length", fileContentLength.ToString());

I've tried as many various on caching options and headers as I can think of
and I can't avoid the following behavior:

For certain types of file, like PowerPoint or Word, clicking on a file href
causes:
* IE prompt for a "what do you want to do with this file?". It has the right
type displayed and name.
* Pressing either of these options then results in a Microsoft Powerpoint
dialog saying "Could not open <fullurl>"
* Clicking ok to that dialog causes IE to display an error "could not
download <whatever.ppt> from <somehost>".
* Looking at the web logs IE does NOT execute any further calls to our
application. The only call we see is the single request for the file which
is returned.

For other types of file, like Jpegs, clicking on the href opens the file
within IE and displays the image correctly.

Right-clicking on the href and selecting "Save as" works.

Setting a context-disposition header doesn't make any difference to the
problem above. Removing the "no-cache" header and letting the private cache
expire after 0 minutes works in all cases above - but the file remains in
the machines cache - something we'd like to avoid.

One hypothesis is that IE first downloads the file to a temporary file,
deletes it (no cache), the asks the user what they want to do with it -
which of course fails (or deletes it after the user chooses before
powerpoint sees it or it can be saved).

What am I missing? Is there any way to set "no-cache" for powerpoint and
succeed in opening it once the IE "save/open" dialog appears?

Thanks
Jonathan
Nov 18 '05 #1
2 3132
In the future, you'll probably want to ask a question like this in one
newsgroup at a time, since it's unclear how many replies you've already
gotten for this question.

This is pretty lame, eh? See
http://support.microsoft.com/default...NoWebContent=1

This refers to SSL delivered documents, but I don't know of any reason this
would only affect SSL.

It's unclear what threats you're trying to mitigate here. Can you
elaborate?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.


"Jonathan Trevor" <tr****@fxpal.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
Hi,

For the last couple of releases of a product we're developing we've been
running to very wierd behavior from IE and our ASP.NET web application which serves up various types of files and I'm getting very frustrated in trying
to solve it!

We content we are serving up is potentially sensitive and therefore we DO
NOT want it cached on the remote client (IE) beyond the lifetime of the
application rendering it (IE, Powerpoint, Word etc.). Clearly the user can
mess this up but thats another issue.

So on the request for a file we set:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

- or -

Response.Cache.SetNoStore();
Response.Cache.SetNoServerCaching();

The rest of the headers get set pretty much as you'd expect:
Response.StatusCode=200;
Response.ContentType = fileContentType;
Response.AppendHeader("Content-Length", fileContentLength.ToString());

I've tried as many various on caching options and headers as I can think of and I can't avoid the following behavior:

For certain types of file, like PowerPoint or Word, clicking on a file href causes:
* IE prompt for a "what do you want to do with this file?". It has the right type displayed and name.
* Pressing either of these options then results in a Microsoft Powerpoint
dialog saying "Could not open <fullurl>"
* Clicking ok to that dialog causes IE to display an error "could not
download <whatever.ppt> from <somehost>".
* Looking at the web logs IE does NOT execute any further calls to our
application. The only call we see is the single request for the file which
is returned.

For other types of file, like Jpegs, clicking on the href opens the file
within IE and displays the image correctly.

Right-clicking on the href and selecting "Save as" works.

Setting a context-disposition header doesn't make any difference to the
problem above. Removing the "no-cache" header and letting the private cache expire after 0 minutes works in all cases above - but the file remains in
the machines cache - something we'd like to avoid.

One hypothesis is that IE first downloads the file to a temporary file,
deletes it (no cache), the asks the user what they want to do with it -
which of course fails (or deletes it after the user chooses before
powerpoint sees it or it can be saved).

What am I missing? Is there any way to set "no-cache" for powerpoint and
succeed in opening it once the IE "save/open" dialog appears?

Thanks
Jonathan

Nov 18 '05 #2
Thanks for the pointer.

We're trying to avoid a user leaving copies of private documents on public
machines by accident. Clearly to do this really well you'd need some digital
rights type support (+encryption) or requiring a "trusted" viewer for
documents on that machine which you can guarantee won't leave a copy
anywhere. However, it seemed that setting "no-cache" would be a good way to
allow documents to be viewed on the machine which would then not be
available after the user had left it. If the user made the choice to
download it and then leaves it, then fine (but not good :-) )

While I understand that a temporary file must be created for ppt (etc) to
open (although what they do with webdav is more interesting) I'm not sure
why IE couldn't open powerpoint, and then cleanup after ppt exits -
presumably it does the same for itself when opening large files it can host
(like jpgs which open directly in IE). Even more annoyingly there is no way
to determine what behavior to expect from different browsers/clients - it
depends on what applications are installed, how they integrate with IE, and
even what versions are installed. For example, clicking "open" on some
machines causes powerpoint to launch and on others causes IE to host the
powerpoint document.

Finally, I'm not convinced the behavior is consistent as the "Save As"
choice will fail on the "SaveAs/Open" dialog - but if you right click on the
document link and click "Save as" from the menu then it saves without
problems!

Basically, I'd like some consistent behavior when the user clicks on
"Download this document" - i.e. it should never fail wierdly (such as "Save
As" or "Open" failures).

Jonathan

"Eric Lawrence [MSFT]" <e_********@hotmail.com> wrote in message
news:eD****************@TK2MSFTNGP10.phx.gbl...
In the future, you'll probably want to ask a question like this in one
newsgroup at a time, since it's unclear how many replies you've already
gotten for this question.

This is pretty lame, eh? See
http://support.microsoft.com/default...NoWebContent=1
This refers to SSL delivered documents, but I don't know of any reason this would only affect SSL.

It's unclear what threats you're trying to mitigate here. Can you
elaborate?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"Jonathan Trevor" <tr****@fxpal.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
Hi,

For the last couple of releases of a product we're developing we've been
running to very wierd behavior from IE and our ASP.NET web application

which
serves up various types of files and I'm getting very frustrated in trying to solve it!

We content we are serving up is potentially sensitive and therefore we DO NOT want it cached on the remote client (IE) beyond the lifetime of the
application rendering it (IE, Powerpoint, Word etc.). Clearly the user can mess this up but thats another issue.

So on the request for a file we set:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

- or -

Response.Cache.SetNoStore();
Response.Cache.SetNoServerCaching();

The rest of the headers get set pretty much as you'd expect:
Response.StatusCode=200;
Response.ContentType = fileContentType;
Response.AppendHeader("Content-Length", fileContentLength.ToString());

I've tried as many various on caching options and headers as I can think

of
and I can't avoid the following behavior:

For certain types of file, like PowerPoint or Word, clicking on a file

href
causes:
* IE prompt for a "what do you want to do with this file?". It has the

right
type displayed and name.
* Pressing either of these options then results in a Microsoft Powerpoint dialog saying "Could not open <fullurl>"
* Clicking ok to that dialog causes IE to display an error "could not
download <whatever.ppt> from <somehost>".
* Looking at the web logs IE does NOT execute any further calls to our
application. The only call we see is the single request for the file which is returned.

For other types of file, like Jpegs, clicking on the href opens the file
within IE and displays the image correctly.

Right-clicking on the href and selecting "Save as" works.

Setting a context-disposition header doesn't make any difference to the
problem above. Removing the "no-cache" header and letting the private

cache
expire after 0 minutes works in all cases above - but the file remains in the machines cache - something we'd like to avoid.

One hypothesis is that IE first downloads the file to a temporary file,
deletes it (no cache), the asks the user what they want to do with it -
which of course fails (or deletes it after the user chooses before
powerpoint sees it or it can be saved).

What am I missing? Is there any way to set "no-cache" for powerpoint and
succeed in opening it once the IE "save/open" dialog appears?

Thanks
Jonathan


Nov 18 '05 #3

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

Similar topics

1
by: Ryan | last post by:
PowerPoint.Application cannot open PPT file I am trying to use the following code using to open a PPT file using VS.NET 2003 and PowerPoint 2003 Option Strict Off Imports...
2
by: WillRead | last post by:
I have a VB.Net application and a PowerPoint presentation explaining how each form in the application works, etc.. I would like to select and display the slide appropriate for each form by pressing...
4
by: Joseph | last post by:
I am trying to open a 3 powerpoint presentation simultaneously afte each other without interruption, the operator of the application doe not need to notice anything or interfere in the operation of...
0
by: Marc Eggenberger | last post by:
Hi there. I have an webapp (asp.net) which should use powerpoint to create a presentation and then send that presentation to the user. I'm using VS2003 and Office2003 (project req.). The...
8
by: Rut | last post by:
Does anyone know how to start powerpoint from vb.net without the ppt screen appearing. I want to keep it hidden? Using this code: Try pp = New PowerPoint.Application pp.Visible =...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
35
by: gill1978 | last post by:
Hi, What I'm trying to do is, once the users select the files they want to merge, they select a button which will: 1. Open an instance of powerpoint 2. Open the first of the files selected...
8
by: =?Utf-8?B?R2VvcmdlQXRraW5z?= | last post by:
Greetings! I wrote a small Exe that simply runs Shell to load PowerPoint and launch a particular file, depending on the day of the week. However, it was set up for office 2003 (I naively hardcoded...
1
by: chrizstone | last post by:
Hi Guys, What i want to do is: I want to create a Slide programmatically where a Table is on it! Here´s my Code: String strTemplate; strTemplate = template; String...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.