[TIMOB-1360] iOS: issue with 4 letter extension when copying to "Documents" folder on device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:55:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | iOS |
Labels | ios |
Reporter | Thomas Huelbert |
Assignee | Blain Hamon |
Created | 2011-04-15T02:50:26.000+0000 |
Updated | 2011-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);
}
Note to self: Filesystem module, to handle resources that are stored in-binary, has a different logic path for .html, .js, and .css.
I'm unable to duplicate in either simulator or on device. Does this occur only with products built via Titanium Developer?
Tested in TiDev as well. I'm unable to reproduce this. Can you, Thom?
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.