[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Cannot download .xlsx file from Apache webserver

Posted on 2009-05-19
5
Medium Priority
?
742 Views
Last Modified: 2012-05-07
I am trying to add a hyperlink to a PHP page running on our local webserver running Apache 2.2.11. I am linking an Excel 2007 spreadsheet (.xlsx) II have no administrative rights to this server, just the webroot.

When I link to this file, it tries to load a bunch of garbage into my browser window. If I right click the link and Save As, this works just fine, however I would like a download prompt when users click on this link.

I have added an .htaccess file in the directory of the PHP page and xlsx file. with just the line below, thinking this might clear the issue up, but it has not. I should also note that .xls (Excel 2003 and previous) files will behave correctly when clicked. What am I missing here?
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx

Open in new window

0
Comment
Question by:Tabris42
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:Tabris42
ID: 24425587
To add more to this mystery, I only get the junk in Firefox, here's a sample of the first bunch of it:

PKýýýýý!ýuBýRýýýýýýýý[Content_Types].xml ýý(ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýUýNý0ý#ýýýýq      !ý# ý|ýýýýý6ýýýý=ýVPýH%H\ýpý3ýýýýývSWýg3qýýE6wýý"ýýýuHýýjr2ýýýÓý|ýýýýýýýýHýy      ýýýyýýeýBýý_C!ý—ýýy1_ýýYK#ýb:ýýýZUý<lxýUýfýHýýý"U&ýýýýPýýýdý ýývýfý}ýýýýýJ}0ýf@      ýýýýýýýýýý:G<ýMýhH^Tý'Uý&ýý$qýý^ýSýýýý8ý
ýYDýi[ýýýP ýcý(Hý

However when I download with IE, it downloads it, but wants to treat it as a .Zip file! I do have Office 2007 on my machine.
0
 
LVL 1

Expert Comment

by:halonx
ID: 24425704
Does your web host have "AllowOverride" turned on?

If so, do they have a custom file name to use instead of .htaccess?
0
 

Author Comment

by:Tabris42
ID: 24425893
Couldn't tell you... the guy who runs this server just went on leave for 4 months and noone else knows anything about the server, unfortunately. Is that the only way I can make this work?
0
 
LVL 1

Accepted Solution

by:
halonx earned 2000 total points
ID: 24425938
AllowOverride definitely needs to be turned on for you to use a .htaccess file.  

If you had access to the Apache server config you could either turn AllowOverride on or just add the file type to the base Apache config.
0
 

Author Comment

by:Tabris42
ID: 24466522
Thankfully the guy acting for the other guy who went on leave for four months knows his stuff and knew exactly what I was asking for. He did not enable AllowOverride, but instead made the Office 2007 file formats downloadable from the webserver. Thanks for your answer!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question