1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    61
    Answers
    3
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default Unanswered: DataItem; given an url download file on tap

    Unanswered: DataItem; given an url download file on tap


    Given an url is it possible to download the file by taping on a DataItem?

    I have searched through forums and none of the suggestions proposed have worked so far. I'm developing on Android 2.3.6 platform.

    window.open() doesn't work and almost any other solution I tried works on my workstation but not on the smartphone.

    Any suggestion on how can I do this? Is this issue contemplated or addressed in any future release of Sencha Touch?

    Thank you very much.
    Last edited by arael78; 28 Sep 2012 at 1:23 AM. Reason: grammar and spelling

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,399
    Answers
    3549
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    location.href to the file should trigger the download.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    61
    Answers
    3
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    Thank you for the suggestion. Unfortunately this works only for txt, html and image files. Most of my contents are pdf, docs, ppt, and zip files. And the location.href doesn't work with these files.

    Another problem is that the opened files are then visualized fullscreen but no user interaction is possible. The user cannot save the file. He/She can only go back and when he/she does the application is reloaded or the application exists.

    Is it possible somehow to perform and ajax call, setting some cookies and download the content locally on the sdcard? Then once the file is downloaded I would need to open it by starting an external application.

    That would solve a major problem in my app.

  4. #4
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    563
    Answers
    6
    Vote Rating
    26
    svenna has a spectacular aura about svenna has a spectacular aura about

      0  

    Default


    This is a new feature of Sencha Touch 2.1 (device.openUrl) - However, I've been unable to get it working with the betas/nightly.

    Forumposts states that the feature it self should be working now, but the building of a native app is not
    Sven Tore Iversen

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    61
    Answers
    3
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    Right now I'm using the PhoneGap FileTransfer function. It works well but there is the problem of opening the file once it is downloaded.

    I'm trying to find a way to open the file with external applications to widen the support to file formats such as zip, ppt, odt, doc, mp4, ecc.

Thread Participants: 2