Flash help > download link

Posted:
in Genius Bar edited January 2014
Quote:

Originally posted by the cool gut

Hi, I'm building a flash site, and want people to be able to download a .MP4 file to their desktop.



So I use the command getURL



Then:



URL:test.mp4

target:blank



All this does is open a new window and fill it with garbage - just random text. It works fine on Windows, this is just with Safari - any idea what's wrong? I think it's the file type?




This is a fault with your browser/web server combo. Windows will always recognise file types from the three letter extention, but when http sends a document it will also include file type information called the mime type. Mac prefers to use the mime type.



The web server will check your file extension, and then look up a list of mime types to send with it. (On mac os this file is /private/etc/httpd/mime.types on other apache based systems it is usually in /etc/httpd/mime.types )



The correct solution is to add the correct mime types to the file. It'll look like one of these (depending on what is in your mp4 file)



For audio only:

audio/mp4 mp4



For binary format A/V:

applications/mpeg4-iod mp4



For text format A/V:

applications/mpeg4-iod-xmt mp4



Good luck.

-t

Comments

  • Reply 1 of 4
    Just noticed mp4 is listed under the 10.4.6 mime.types list. Upgrade your webserver to the latest version.

    Note: for the actual mime types listed above, I just grabbed them from a doc on the net... they may be inaccurate :P
  • Reply 2 of 4
    the cool gutthe cool gut Posts: 1,714member
    Hi, I'm building a flash site, and want people to be able to download a .MP4 file to their desktop.



    So I use the command getURL



    Then:



    URL:test.mp4

    target:blank



    All this does is open a new window and fill it with garbage - just random text. It works fine on Windows, this is just with Safari - any idea what's wrong? I think it's the file type?
  • Reply 3 of 4
    the cool gutthe cool gut Posts: 1,714member
    Well, it seems to work if I ZIP the file - it seems Safari will unzip it automatically, but now it comes down to do I make this easier to download on the Mac or the P.C. -well obviously I'm gonna make it easier on the Mac but any suggestions?
  • Reply 4 of 4
    curiousuburbcuriousuburb Posts: 3,325member
    Browser detect automagically sends platform-specific version?
Sign In or Register to comment.