Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to serve a bunch of gzipped MIDI files from an Apache server. The catch is that when the user requests them, the response should come back with a "audio/midi" content-type header and not a gzip file or multipart header. In other words, Im trying to render the content(play the MIDI) off of the server and not download it to their drive. Is there an easy way I can do this ?

share|improve this question

migrated from stackoverflow.com Mar 12 '11 at 23:50

This question came from our site for professional and enthusiast programmers.

    
Any reason you can't just unzip them on the server? MIDI files are miniscule! –  SpliFF Mar 11 '11 at 4:05
    
So here's the unusual scenario...I have 80-90K MIDI files, all containing repetitive content. And then there need to be 150 versions, each with a different BPM. Which makes this cost about 12-13MB per user uploaded file. It starts to add up really quick. –  udit Mar 11 '11 at 4:23
1  

1 Answer 1

To ensure that Apache looks for randomFile.xyz.gz when the browser randomFile.xyz

Need to add

Options MultiViews

in the apache config.

To ensure the content-type is appropriate, we need to add the following

<Files *.mid.gz>
  SetOutputFilter DEFLATE
  ForceType audio/midi
</Files>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.