excel file displayed as webpage

Problems with the Windows version of XAMPP, questions, comments, and anything related.

excel file displayed as webpage

Postby kpete32 » 27. March 2018 21:15

I have a few PHP files that are used to create webpages that allow users to download excel spreadsheets. These PHP files were on a windows 2003 server running apache 2.0 and they work properly on this server. When I open a browser and navigate to the webpage I am able to click on the download button for the excel spread sheet and windows asks if I would like to download or save the file. I moved the same PHP files to a windows 2012 r2 server and I am now using xammp with apache 2.2.14 and the excel spreadsheet now opens in a webpage instead of asking to be downloaded. I am not sure how to force this file to ask to be downloaded.
kpete32
 
Posts: 4
Joined: 27. March 2018 21:08
XAMPP version: 2.5.8
Operating System: windows server 2012 r2

Re: excel file displayed as webpage

Postby Nobbie » 28. March 2018 06:01

The mime type is responsible for the behaviour of your browser, google for "Apache excel mime type".
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: excel file displayed as webpage

Postby kpete32 » 28. March 2018 13:24

where do i adjust the mime type at? I have a folder in xammp under apache\conf called mime types but it does not look like what I found online.
kpete32
 
Posts: 4
Joined: 27. March 2018 21:08
XAMPP version: 2.5.8
Operating System: windows server 2012 r2

Re: excel file displayed as webpage

Postby Nobbie » 28. March 2018 16:35

google for "xampp mime types"
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: excel file displayed as webpage

Postby kpete32 » 28. March 2018 19:26

I have googled xammp mime types and the mime type for excel files is already in the proper file but the excel file still opens as an html webpage
kpete32
 
Posts: 4
Joined: 27. March 2018 21:08
XAMPP version: 2.5.8
Operating System: windows server 2012 r2

Re: excel file displayed as webpage

Postby Nobbie » 29. March 2018 00:48

Ofcourse you must change the file type, try any compressed type or unknown or so, the browser then does not know that it is excel and offers a simple download.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: excel file displayed as webpage

Postby kpete32 » 25. April 2018 15:11

The file type is set to excel and it opens properly on a windows 2003 server running the same code it just does not work on a 2012 R2 server
kpete32
 
Posts: 4
Joined: 27. March 2018 21:08
XAMPP version: 2.5.8
Operating System: windows server 2012 r2


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 123 guests