1

When I ask for a flash file like http://www.example.com/test.swf on my Caddy server (http://caddyserver.com/), browsers start to download it instead of opening it.

How to set up Caddy so flash file (*.swf) could be directly opened by browser. I think I need to define Mime type on the server side in Caddyfile. What parameter should I set?

1

1 Answer 1

1

By default, Caddy sends binary files as application/octet-stream which, in most clients, triggers a download. You want it to be application/x-shockwave-flash.

With Caddy 0.8+

Add this to your Caddyfile:

mime .swf application/x-shockwave-flash

(Thanks to the comment reminding me to update this answer.)

Old Answer:

Add this to your Caddyfile (assuming all .swf content is in a folder called flash):

header /flash Content-Type application/x-shockwave-flash

This sets the Content-Type for all files in /flash to the more correct value (header directive docs). In a future version of Caddy we'll probably have a way of customizing MIME types. (Update: Now we do!)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.