Downloading the pkpass file from a Java webapp

Hello,
I generated a sample pkpass http://www.tomttb.com/test/pass/full_sample/ and placed it within my web app developed on java.
I wrote a simple servlet deployed on tomcat 7.0 to download the sample file (say pass.pkpass) from my server on to my iphone device with ios 6 upgraded.
The URL to download the pkpass file looks like this -> http://<the ip>:8080/Sample/.
The java code for sample servlet looks exactly as wahtz shown below. The download works fine on my Mac book, but when try the same on Safari within the device, it says 'Safari could not download the file!'. Am not able understand where the problem is! any help from the experts are highly appreciated.
public class ServletDownloadDemo extends HttpServlet {
          public void doGet(HttpServletRequest request, HttpServletResponse response)
                              throws IOException {
                    File f = new File("D:/MyPrjct/Sample/WebContent/pass.pkpass");
                    int length = 0;
                    response.setHeader("Pragma", "no-cache");
                    response.setHeader("Content-type", "application/vnd-com.apple.pkpass");
                    response.setHeader("Content-length", (int) f.length() + "");
                    response.setHeader("Content-Disposition",
                                        "attachment; filename=pass.pkpass");
                    // response.setContentType("application/vnd-com.apple.pkpass");
                    // response.setContentLength((int) f.length());
                    // response.setHeader("Content-Disposition",
                    // "attachment; filename=\"pass.pkpass\"");
                    ServletOutputStream op = response.getOutputStream();
                    byte[] bbuf = new byte[10000];
                    DataInputStream in = new DataInputStream(new FileInputStream(f));
                    while ((in != null) && ((length = in.read(bbuf)) != -1)) {
                              op.write(bbuf, 0, length);
                    in.close();
                    op.flush();
                    op.close();
Thanks,
Kamal.

Maybe it has something to do with the fact that the iPhone does not support Java...
Try posting in the developers forums. This forum is for issues with iPhone accessories.

Similar Messages

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • I just purchased Acrobat Pro XI i downloaded the installation file from a different computer because mnes has no internet i click to setup/ install ot says "Acrovat instiller encountered an unexpected failure.  please try again. if continues contact dobe

    I just purchased Acrobat Pro XI i downloaded the installation file from a different computer because mnes has no internet i click to setup/ install ot says "Acrovat instiller encountered an unexpected failure.  please try again. if continues contact dobe support. " how can i install ot to my computer whats going on??

    I just purchased Acrobat Pro XI i downloaded the installation file from a different computer because mnes has no internet i click to setup/ install ot says "Acrovat instiller encountered an unexpected failure.  please try again. if continues contact dobe support. " how can i install ot to my computer whats going on??

  • "Distribution Certificate is not valid" - error downloading the ZIP file from App Builder

    Hello everybody,
    I'm trying to download the Distribution App (.ZIP) from App Builder.
    - The App is made with a Professional account
    - The app is a Multi-folio for iPad-iPhone
    - The App has the Push notifications option activated
    - I made a couple of Push Certificates (production + developing), I checked on Apple Keychain and they are valid (green dot)
    - I made a new App ID with Push Notification option enabled
    - I made a couple of mobileprovision files (production + developing) based on the App ID and
    - I download the .IPA and it work
    The App Builder report this error: "This is not a valid Apple Distribution Certificate"
    Any ideas?
    Is this related to the Pro account and the fact that I made another App for Android?
    Has someone the ability to try using the same settings to understand if it is a bug or a real issue?
    Thanks,
    Andrea Spinazzola
    Ps.: Obviously, we are on deadline...

    Hi Neil,
    as you can imagine reading my list, I already do everything you suggested to me.
    So It's not my mistake, I need to know if it is a bug or a known behavior.
    When I'm talking about Pro Account and Android App, I mean that a Pro Account is for only one "project" (no more infinite Apps as in the past) and due to a content issue, I had to create two Application Account with two different Adobe ID and emails.
    Is this the cause?
    I appreciate every help that could solve my problem but just to let you know, I work on DPS since it start and this is about the fifteenth apps that I did in the last 5 years, so I know exactly how it works.
    Have you tried to reproduce my list of thing?
    It works for you?
    Yes?
    No?
    I have a problem, i can't generate with DPS App Builder "App distribuzione.zip" to be sent to Apple to publish APP, this is the error message: is not a valid distribution certificate Apple. What do I do?
    Same problem, same answers, same unsolved problem.
    I made new certificates (it was the first thing I did) and It doesn't work.
    Thanks.
    Andrea

  • My home page is firefox. Today when I signed on firefox I recieved a message from my antivirus that mozilla attempted to download the following file from your site. Trojan-Downloader.JS.Iframe.cgq

    When I clicked on Firefox to start and as it opened my antivirus immediately named the Trojan, keeping the Trojan from downloading to my machine. The Trojan was found within Mozilla at C:\Users\nameofmachine\APPDATA\LOCAL\MOZILLA\FIREFOX\Profiles\8m239aat.default\Cache\2\BD It appears subsequent attempts have not happened.

    Thank you very much Computer Whiz. I suspected the the pop-ups should be allowed & I made saure the box was not blocking in"Tools> Unfortunately I went back to CBC Archives on line but the window had no change. There was no "pop-up" from HDS Link Detector. The video clip just played as it normally does in the "on-line" player. The HDS icon in the lower right hand corner of the window is red (meaning"enabled", so it seems the "pop0up" should appear when I go to the CBC site. Maybe it's an extra difficult video to get a pop-up? I don't know how those other guys manged to download the video using HDS Link Detector. Here is the link to the video that I've tried to capture for a year:
    http://www.cbc.ca/player/Digital+Archives/CBC+Programs/Television/Tabloid/ID/1404668920/
    Anyway, THANKS very much for the courtesy in trying to be so helpful. Best wishes!

  • Downloading an XML file from Website through BPEL/ADAPTER

    Hi,
    I want to download an xml file from one webpage through BPEL. I am using jdeveloper 10.1.3.3 to create a BPEL process and Adapters.
    Is there anyway to download the xml file from the site through FUSION middleware.

    what do you mean download, is it a site where you click a hyperlink then down load the file.
    This is not possible as this is invoked by human intervention. SOA suite is invoked by events. If you want to perform this kind of function you would need to create a jave service to perform this.
    Is there any posibility that there is a FTP link that you could use?
    cheers
    James

  • Downloading an XML file from Website through FUSION middleware

    Hi,
    I want to download an xml file from one website through BPEL. I am using jdeveloper 10.1.3.3 to create a BPEL process and Adapters.
    How can i download the xml file from the site through FUSION middleware?

    Another option would be to write a smal Java class the uses URLConnect to connect to the URL in question and use WSIF to bind it to the BPEL process.
    Just google for sample code.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                           

  • Where I can download the .sca files

    Hi All,
    Can some one tell me from where I can download the following files from the service marketplace.
    SAP_JTECHS.sca
    SAP_BUILDT.sca
    SAP-JEE.sca
    Let me know the exact path to reach this files in the marketplace.
    Thanks,
    Srinivas

    Hello,
    You can download the files from following links, select NetWeaver04 or NetWeaver04s as per your requirement.
    SAP_JTECHS.sca
    service.sap.com/swdc --> Support Packages and Patches --> " SAP NetWeaver" --> SAP NETWEAVER" --> SAP NETWEAVER 2004S" --> Entry by Component" -->Application Server Java --> SAP JAVA TECH SERVICES 7.00 --> #OS independent
    SAP_BUILDT.sca
    service.sap.com/swdc --> Support Packages and Patches --> " SAP NetWeaver" --> SAP NETWEAVER" --> SAP NETWEAVER 2004S" --> Entry by Component" -->Application Server Java --> DI BUILD TOOL 7.00 --> #OS independent
    SAP-JEE.sca
    service.sap.com/swdc --> Support Packages and Patches --> " SAP NetWeaver" --> SAP NETWEAVER" --> SAP NETWEAVER 2004S" --> Entry by Component" -->Application Server Java --> SAP J2EE ENGINE 7.00 --> #OS independent
    please reward points.
    Cheers,
    -Sunil

  • Problem when downloading the JAR file

    I'm just install JRE and testing my first applet application. I'm facing the problem that I can not download the JAR file from my localhost computer.
    I've enable cache in Java Control Panel and running my applet. Normally, it will download the jar file from my localhost and save it to the cache directory of Java. And then finding all classes neccessary to run my applet in the JAR file.
    But I discover that I can not download the JAR file and save to my computer. I try to put the URL to download this JAR file (http://localhost/myjar.jar) in my web address, it start to download this file properly. But when open it with WINRAR, I got an error that the file "Unexpected end of file".
    I try to put this file from onther computer in my LAN. And use the URL to download it. This time I can open the JAR file with WINRAR althrought the file size is the same
    Anyone know why there are some errors when download from my localhost? Thanks in advance for any help!!!

    Yeah everything matches up!
    Could it have something to do with the string encoding? I created the file in ANSI format? Would this have an effect on it?

  • Pls help. My Camera Raw, CS6 and Lightroom won't read the NEF files from D610.

    I recently upgraded to Nikon D610 and the NEF files were not readable from my old version of Camera Raw, CS6 and Lightroom. So downloaded the recommended upgrades and I now have Camera Raw 8.4.0.199; Lightroom 5.3; CS6 13.01. But still did not read my D610 NEF's. Please help. Thanks.

    oh wait, i got it. Just in case for those who will have the same scenario. I downloaded the NEF files from my D610 using the old ViewNX 2.1 software and that was the cause of incompatibility. So i upgraded my ViewNX to 2.9 and downloaded my images again. And it worked this time.

  • How to download a pdf file from the server from an strut application?

    Hi,
    I wan to download a pdf file from the server side to local system. Please help me how i use the down load option.

    Read up on the Struts download action [1].
    And next time, please post in the relevant forum, one of the web-tier ones [2].
    [1] http://wiki.apache.org/struts/StrutsFileDownload
    [2] http://forum.java.sun.com/category.jspa?categoryID=20
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • How to edit the existing data in the XML file from java programming.

    Hi all
    i am able to create XML file with the sample data as below from java programming.
    i need sample code on how to edit the existing data in the XML file?
    for example
    <?xml version="1.0"?>
       <mydata>
               <data1>
                         <key1>467</key1>
                        <name1>Paul</name1>
                        <id1>123</id1>
              </data1>
              <data2>
                         <key2>467</key2>
                        <name2>Paul</name2>
                        <id2>123</id2>
              </data2>
        </mydata>
    i am able to insert the data in the XML.
    now i need sample code on how to modify the data in the above XML file from the java programming for only key2,name2,id2 tags only. the remaining tags data in the XML file i want to keep same data except for key2,name2,id2 which are i want to modify from java code
    Regards
    Sunil
    [points will be always rewardable]

    hi
    u need a parser or validate the xml file for to read the xml file from java coding u need for this
    xml4j.jar u can download this file  from here
    http://www.alphaworks.ibm.com/tech/xml4j
    or we can use the SAX(simple API for XML)
    some sample applications for this
    http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html
    http://www.developertutorials.com/tutorials/java/read-xml-file-in-java-050611/page1.html
    http://www.xml-training-guide.com/e-xml44.html
    let me know u need any other info
    bvr

  • From where can I download the jar files to use JAXB 2.0?

    Hi all,
    From where can I download the jar files to use JAXB 2.0?
    ~Regards

    Does the government not let you do Internet searches where you live? My Internet search for "JAXB 2.0" returned this:
    https://jaxb.dev.java.net/
    as the first link. If you can't find it from that page it doesn't exist.

  • I downloaded a word file from an inbox mail (the mail app) onto my iPad2, where is this file stored? How can I delete it if it takes up space in my iPad? Any ideas??

    I downloaded a word file from an inbox mail (the mail app) onto my iPad, where is this file stored? How can I delete it if it takes up space in my iPad? Any ideas??

    Did you ever figure out what happened?
    I had the same experience as you did, but in my case it was a big fat pdf that Mail insisted I had to download before I could view it. As happened with you, I saw the file actually downloading, and after a time I was able to view the pdf. It's been my assumption that the pdf is still somewhere on my iPad, but I have no idea where, nor how to delete it if it is still there.
    Thanks.

  • I downloaded an Adobe file from my email but cannot find it on my hard drive or in recycle bin - it's in downloads but am unable to open from downloads - how can I recover the file?

    I downloaded an Adobe file from my email (service provider is MWeb) but now cannot find it on my hard drive and it's not in the recycle bin. It does, however, appear in Firefox downloads but I'm unable to open it from there. How can I recover the file?

    Thanks Rob.
    I actually had no clue what the core problem was caused by. So it's Windows itself...that helps some.
    I'll resubmit there. It might actually have saved time for it to simply have been moved to there instead of off-topic, though I suppose you have to follow protocol.

Maybe you are looking for

  • "Unable to load replica"- Can I just start over???

    I am just in the beginning stages of setting up a new server. When it came time to create network user accounts I was unable to and upon further investigation realized that the open directory isnt properly set up. Long story short, since I have no us

  • Error message in iDVD '08 - A valid DVD drive could not be found

    I did the basic updates that always pop up and this error appeared the same day when I went to go use my dvd player (that I use on a daily basis and never had a problem with till now); "A valid DVD drive could not be found. I'm running on an iMac 10.

  • Adobe device central cs5 has stopped working

    I am using cs5 on windows 7. When I tried to browse for new devices using Browse Devices, the progress window displayed "processing 0 from 587" and then the window with the above title popped up and just prompted me to close the program. I noticed th

  • Nike+ syncing doesn't work

    I had been looking into getthing the Nike+ kit for my 6th gen nano so I was really happy when the latest update removed the need for the extra hardware, and does everything natively on the nano.  However, after wasting several hours banging my head a

  • BorderLayout Problems - URGENT

    I am writing an applet and am having some problems with the borderlayout. My applet is set to use a GridBagLayout for the applet container. With in the GridBag is another panel called viewer. This panel is set to use the BorderLayout. With in the vie