473,748 Members | 10,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent Excel from opening in browser

I've got an intranet application that presents a list of files in sort of a
'central repository' web page. Each file is an href in the form <a
href=file://server/share/path/filename.ext>.

When the user clicks on an excel file, it is opening within the browser,
which unforntuntely confuses the heck out of them because the usual
Print/Print Preview menu options are not available. I would like the user
to be presented with the typical Open/Save dialog when clicking on this
link.

Over the past 16 hours or so, I've seen references to adding headers to the
repsonse, setting the content type to attachment to prevent the browser from
opening it. However, this only works if I'm generating the content or if
the file resides on the web server. The files in this case reside on
servers throughout the company.

Is there any way that I can force the browser to do the same thing as 'Save
Target As', without modifying the user mime configuration in IE (another
common suggestion), or hosting the files on the web server?

tia,

Bob M..
Jul 19 '05 #1
1 6936
In your scenario, you will need to make a change on the client machines.
The change is:

Windows Explorer:
Tools(View if NT) - Folder Options - File Types - XLS file extension (Excel
workbook if NT)
Browse in same window = FALSE
Confirm open after download = TRUE

Ray at home

"Bob Murdoch" <ra***********@ erols.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I've got an intranet application that presents a list of files in sort of a 'central repository' web page. Each file is an href in the form <a
href=file://server/share/path/filename.ext>.

When the user clicks on an excel file, it is opening within the browser,
which unforntuntely confuses the heck out of them because the usual
Print/Print Preview menu options are not available. I would like the user
to be presented with the typical Open/Save dialog when clicking on this
link.

Over the past 16 hours or so, I've seen references to adding headers to the repsonse, setting the content type to attachment to prevent the browser from opening it. However, this only works if I'm generating the content or if
the file resides on the web server. The files in this case reside on
servers throughout the company.

Is there any way that I can force the browser to do the same thing as 'Save Target As', without modifying the user mime configuration in IE (another
common suggestion), or hosting the files on the web server?

tia,

Bob M..

Jul 19 '05 #2

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

Similar topics

2
5729
by: Jeremy | last post by:
Hi, I am using the code below to create an excel document from data that is returned from an sql query. The formatting of the excel document is pretty and all is good unless I hit the back button and run my query a second time, or a third time (I haven't made it past 3 times). Basically what happens is every time I do this, excel does not close once I hit my back button. Does anyone have a solution to this problem? Another problem is...
6
3074
by: Divya | last post by:
Hi, I have a web page which generates a CSV file based on some user input. When this file is downloaded by the user, the file is being automatically converted to .xls. Any idea how I can prevent this? My code (snippet) - StreamWriter sw; if(File.Exists(filename))
4
2224
by: Vishal | last post by:
Hello, I have a dataset with some content. I can convert this dataset in a csv format which is then stored in a stringwriter. Now I want this be open via excel, so I set the contenttype "application/vnd.ms-excel". To access this page the user requires to login, once the user is logged in he can access this file. Now when this file is opened in excel it shows me the login screen instead of the data. The user is already logged in, so why...
6
6767
by: Daniel | last post by:
Hi all, Can i open and edit the excel sheet on web page after downloading? After editing, i close the web page and the excel file auto upload to the server. Is it possible? I really struggling about the ability. If not, what advice can u provide? thank you in advance. ur help will be appreaciated.
2
289
by: monalisa | last post by:
I have a Datagrid in ASP.NET , Witch contains employee info and a Dropdownlist and a calendar control. For performance issue, the user wanted to fill this form in Excel, so I need to export the Data to Excel file to be (offline), and create the drop down list dynamically into the excel. How I can do it , and if there is another suggestion of doing this (infoPath)
0
1285
by: Matt Schwartz | last post by:
I have a ASP.NET web application written using VB.NET. I have a data grid, that is sent to the browser as an excel document using the following code Private Sub CreateXLS(ByVal xdatagrid As DataGrid) Response.Clear() Response.AddHeader("content-disposition", "filename=New_Report.xls") Response.Charset = "" Response.Cache.SetCacheability(HttpCacheability.NoCache)
3
2199
by: Fauna | last post by:
I'm having an Excel problem. I hope this is the appropriate group to post in. I am converting an existing classic ASP web application to ASP .NET. There is a reporting menu where the user clicks on a link and it opens an Excel file in the browser. The browser we are using is IE 6. The old application does this via a javascript open-new-window function. I've successfully re-written the process in ASP .NET (via Visual Studio 2005),...
4
11957
by: JaxDawg | last post by:
I have a spreadsheet saved as an XML spreadsheet so I can manipulate it easier (and don't need COM). When I'm done, I want to display to the user. Currently, I'm using simple JavaScript in my PHP file to display the file when complete: echo '<script type="text/javascript"window.open("'.$file_nm.'")</ script>'; Since the file is .XML, which defaults to the browser to open - the above code will display the XML as raw XML (text) in a new...
4
3981
by: =?Utf-8?B?THluZXJz?= | last post by:
Hello All, We have a VB.NET application writen using VS 2003. This application apens an excel file from a vendor, reads the data and performs whatever functions it needs. We recently upgraded our sytems to Excel 2003 from Excel 2000. Our application started erroring out because it was having a problem with opening the Excel file. From troubleshooting, the exact problem is in Excel 2003, it does not like the sheet name (even though the...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9370
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8242
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.