Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23319] Windows: Ti.Platform.openURL does not open some media files

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-03-23T18:37:20.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelsn/a
ReporterGary Mathews
AssigneeKota Iguchi
Created2016-05-05T06:20:42.000+0000
Updated2017-03-24T16:58:23.000+0000

Description

Currently, Ti.Platform.openURL will attempt to open the a URI using LaunchUriAsync. However, certain file types won't open. Should we allow the content-type to be specified? We could also use https://msdn.microsoft.com/en-us/library/windows/apps/hh701471.aspx
    var xhr = Ti.Network.createHTTPClient();
    xhr.setTimeout(6e4);

    xhr.onload = function (e) {
        var to = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'goalsetting.pdf');
        to.write(xhr.responseData);

        Ti.Platform.openURL('ms-appdata:///local/goalsetting.pdf');
    };
    xhr.onerror = function (e) {
        alert('FAILED TO DOWNLOAD');
    };

    xhr.open('GET', 'http://bdrconsultants.com/goalsetting.pdf');
    xhr.send();

Comments

  1. Kota Iguchi 2017-02-15

    https://github.com/appcelerator/titanium_mobile_windows/pull/955
  2. Samir Mohammed 2017-03-24

    Fix verified in 6.1.0.v20170323174407, Test steps and other information can be found in: https://github.com/appcelerator/titanium_mobile_windows/pull/955

JSON Source