5 Replies Latest reply on Mar 27, 2008 3:43 AM by Dr. Fred Mbogo

    launch instead of download air file from browser

    ilsh Level 1
      How can I setup the url so that when users click the link, the air file will install (suppose AIR runtime already installed on the local computer) rather than download?

      For unknown reasons, when I click the air file link, WinRar will try to open it and the system automatically change the .air extension to .zip.
        • 1. Re: launch instead of download air file from browser
          Dr. Fred Mbogo Level 1
          Search the manual for badge.swf. Yes, you need to use a badge to get the behavior you seek. You can build a custom badge if you don't like the provided one. The source code to badge.swf is included with the Flex samples.
          • 2. Re: launch instead of download air file from browser
            Oliver Goldman Adobe Employee
            The badge is not required for the download case--only for install or launch from a web page.

            The problem here is likely that the MIME coontent type being reported by the web server is wrong. If the web server doesn't know about .air files, they typically end up being sniffed and guessed to be .zip files. See, for example, http://www.davidtucker.net/2008/01/08/update-your-air-mime-type/.

            Oliver Goldman | Adobe AIR Engineering

            • 3. Re: launch instead of download air file from browser
              Dr. Fred Mbogo Level 1
              Actually, I would consider the badge required. A browser may have all the information it needs to launch the AIR file correctly for installation, but any security-conscious browser setup won't, for security reasons. If you want one click on the web page to initiate an install, you need a badge.
              • 4. Re: launch instead of download air file from browser
                ilsh Level 1
                David Tucker's blog is helpful. However, I have no control to change the Apache setting. :( Any idea how to get around the zip problem?

                I already tried badge and it works fine. But most people still don't have the latest flash player installed, so what they see is only a link. And that's why I asked this question in the first place.

                Thanks,
                • 5. Re: launch instead of download air file from browser
                  Dr. Fred Mbogo Level 1
                  There are many possibilities out in the world:

                  1. Flash not installed at all

                  2. Flash installed, but old

                  3. Flash installed, but JavaScript disabled so you can't call it

                  4. Both JS and Flash disabled, so you need instructions to enable JS to get to tests for the first two possibilities.

                  Your download page has to handle all of these cases, and guide the users through the steps needed to get JS running and Flash 9.0.115 installed. Then the badge appears, and all is well. They're going to need to have Flash installed anyway to run your app, so they might as well get it running to make the web page happy.

                  As for the Apache setting, you may actually be able to change it iby adding a file called .htaccess in the directory containing the HTML file. It takes the same syntax as the top-level httpd.conf, but this feature may be disabled or set to not allow per-directory MIME types. It's worth trying.