Alpha Video Training
Results 1 to 5 of 5

Thread: PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

  1. #1
    Member
    Real Name
    craig soady
    Join Date
    Jun 2016
    Posts
    3

    Default PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

    Hi All,
    I have a requirement to access stored files (mainly PDF) on my server. I have successfully built a test App that can access a PDF file on a pubic server and load it on an iPad using the PhoneGap Document Handler .

    I'm just not sure how I can access files on a secured server without opening up access to the public.

    Ideally what I want in the App is have a list of available files that the user has rights to view and then have a download to device button, once downloaded they then can select to view the document.

    Every time the App syncs to the server it checks the document date/time and compares with the document date/time that has been downloaded; if they differ then the App has a warning that the document is old and needs to be downloaded again.

    Any assistance to point me in the right direction would be much appreciated.
    Thanks

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,757

    Default Re: PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

    I've not tried this. Using Security, you could set your PDF files to "File Requires Login". After the user logs in, they should be able to access them... and no one else can.

  3. #3
    Member
    Real Name
    craig soady
    Join Date
    Jun 2016
    Posts
    3

    Default Re: PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

    Thank you for your reply, where do I set the file requires logon?

    I'm currently running the following via a button on a panel card:
    var _url ='http://downloads.alphasoftware.com/Cordova/documentation/alphaphonegapdoc.pdf';
    var _msg = 'Loading';
    showDocument(_url,_msg);


    This is the Javascript:
    function showDocument(_url,_msg) {
    // show wait spinner/message
    var wObj = {};
    wObj.message = arguments[1] || "Loading document, please wait...";

    {dialog.object}.showWaitMessage('page',wObj);


    // call PhoneGap DocumentHandler plugin
    try {
    handleDocumentWithURL(function() {
    {dialog.object}.hideWaitMessage();
    var msg = 'Document loaded.';
    showInfoMessage(msg);
    }, function() {
    var msg = 'Document load failed.';
    {dialog.object}.hideWaitMessage();
    showInfoMessage(msg);
    },_url);
    } catch(e) {
    {dialog.object}.hideWaitMessage();
    alert(e.message);
    }

    }

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,757

    Default Re: PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

    Because you mentioned users and rights I assumed you've got Alpha Security turned on. Do you? If not, and you don't plan on using Alpha Security, then you won't be able to set security on a file. If you are, or are planning on using Alpha Security, then, within Alpha, you can right-click on a component, file, folder, etc. and select the Security option from the right-click menu. And you can set security via the Web Security option in the Web Control Panel.

  5. #5
    Member
    Real Name
    craig soady
    Join Date
    Jun 2016
    Posts
    3

    Default Re: PhoneGap Document Handler - Accessing, Downloading and Viewing FIles

    Hi David,

    I haven't yet implemented security for an iOS App; though I have for a Web App. I'll turn on security and see how I go....

    Thanks for pointing me in the right direction

    Cheers
    Craig

Similar Threads

  1. gzcache and downloading files
    By Scholin in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 10-25-2010, 07:02 PM
  2. Downloading dbf files from WAS back to local DATA directory?
    By bhaub in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 03-01-2010, 07:05 PM
  3. Question on downloading and uploading files
    By davtech in forum Application Server Version 9 - Web/Browser Applications
    Replies: 7
    Last Post: 11-14-2009, 03:23 PM
  4. Viewing and editing a Word document form the WAS
    By drgarytraub in forum Application Server Version 9 - Web/Browser Applications
    Replies: 11
    Last Post: 02-02-2009, 03:50 AM
  5. Downloading files from FTP site
    By Sarah Mengesha in forum Alpha Five Version 5
    Replies: 7
    Last Post: 06-04-2004, 03:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •