Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1360] iOS: issue with 4 letter extension when copying to "Documents" folder on device

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:55:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelsios
ReporterThomas Huelbert
AssigneeBlain Hamon
Created2011-04-15T02:50:26.000+0000
Updated2011-04-17T01:55:58.000+0000

Description

bug came via http://anovice.com/2010/07/16/installing-app-files-with-appcelerator-titanium/"> http://anovice.com/2010/07/16/installing-app-files-with-appcelerato...

the issue is that when copying files from Apps "Resources" folder to the devices "Documents" folder, using a 4 letter extension (html vs htm) fails. This does work in the simulator.

replace htm with html in the following example.

if (Ti.App.Properties.getInt("installComplete") == null) {

 var imgOriginal = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + "/image.jpg");
 var imgInstall = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "/image.jpg");
 imgInstall.write(imgOriginal);

 var dataOrig = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + "/foo.html");
 var dataInstall = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + "/foo.html");
 var dataContent = dataOrig.read();
 dataInstall.write(dataContent);

 Ti.App.Properties.setInt("installComplete", 1);

}

Comments

  1. Blain Hamon 2011-04-15

    Note to self: Filesystem module, to handle resources that are stored in-binary, has a different logic path for .html, .js, and .css.

  2. Stephen Tramer 2011-04-15

    I'm unable to duplicate in either simulator or on device. Does this occur only with products built via Titanium Developer?

  3. Stephen Tramer 2011-04-15

    Tested in TiDev as well. I'm unable to reproduce this. Can you, Thom?

  4. Thomas Huelbert 2011-04-15

    Using 1.4.1.8566ed, iOS sdk 4.0.2, os 10.6.4 I am unable to repro this anymore, I confirmed that the .html file is being installed (tested 4.0.2 and 3.1.2). closing as resolved.

JSON Source