This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HREF="Book.xsl" doesn't work but HREF="Book.zip" works ?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my html page, I have an EXCEL file that I put on web server and want users to be able to download. However, <a href="Book.xsl">click to download</a> does not work. But after I zip this Excel file into a Book.zip file <a href="Book.zip">click to download</a> it seems it works, at least user can "save" it, but "open" has some problem still. I want to know --

1. why does HREF works with .ZIP but not .XSL ?

2. what if I just don't want to zip it and just want user to download the .xsl directly ? How can I do it ? Somebody says I have to put the .xsl on a FTP server instead of a web server. Is that right ?

thanks
 
Marshal
Posts: 67430
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

does not work



Neither does my uncle. He just sits in front of the TV all day with his feet propped up on the ottoman.

Seriously, that doesn't tell us much about what's happening. Nothing? Blank page? Flames from the keyboard?

What is it you want to happen? File save dialog? Excel file opened in the browser?

The answer probably lies in the way that your browser is configured to handle various mime types, but need more info to be sure.
[ May 03, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mentioned the file is EXCEL but the extension you have given to file is .xsl.Try changing the extension to xls.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is this: Your browser is set up to handle files. If it knows the file extension it will open it up. If it does not knwo the file extension it asks you to save the file.

There is no way to really stop it other than telling your user to right click and do a save-as

Eric
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic