2 Replies Latest reply on Mar 16, 2010 4:36 AM by what mean

    Download link not working in Adobe AIR app

    wenball2

      I wanted to let users browse my site as a desktop  application,
      but didn't have the time to write an application from scratch. SO tried following trick. Created a simple Adobe AIR application with a single page.  This page redirects to my website and hence loads the website in the AIR  window.

      Everything is working fine except that the download links are not  working. The download doesn't start. Nothing happens. What is the  solution here? Any help is appreciated.Please,help!!! Thanks!!

        • 1. Re: Download link not working in Adobe AIR app
          wenball2 Level 1

          Any help is appreciated?Please,Please! Thank you for your help!

          • 2. Re: Download link not working in Adobe AIR app
            what mean

            I am now facing the same problem. I wrote a servlet .

            code like this

                     response = (HttpServletResponse) faces.getExternalContext().getResponse();
                     response.setContentType("application/x-download");
                     String agent = request.getHeader("USER-AGENT");

                     boolean isIE=false;            
                    if (null != agent && agent.indexOf("MSIE")!=-1) { 
                        isIE=true;
                    }
                    if (isIE) {
                        fileName = URLEncoder.encode(fileName, "UTF-8");
                    } else {
                        fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
                    }
                    response.setHeader("Content-Disposition","attachment;filename="+fileName);
                    ServletOutputStream os = response.getOutputStream();
                    byte b[]=new byte[1024];
                    int n;
                    while((n=in.read(b))!=-1){
                        os.write(b,0,n);
                    }     
                   in.close();
                   os.close();

            and i open a new window refer to above jsp ,also i set a breakPoint at os.close(),the program has passed through,but nothing happened in the window.

            If i use IE or FF ,the browser will open a small window to allow me select whether open or  save the file.So can anybody give me some advice.Is it because air using webkit engine and the engine does not do this kind of job?

                 
                    Thanks.