<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AppStudio FileInfo Not Working on iOS 12 in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873681#M3394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am testing my AppStudio 3.3 beta app on a 6th Gen iPad running iOS 12. In my code I am trying to access a file using the AppFramework.FileInfo object to verify that the file exists and then read its size. However, the code that works on Windows does not work on iOS. Here is my code:&lt;/P&gt;&lt;P&gt;function checkFile(filePath) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var fileInfo = Qt.createQmlObject('import ArcGIS.AppFramework 1.0; FileInfo { filePath: "' + filePath + '" }', app);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log('File Exists?', fileInfo.exists, 'File Size?', fileInfo.size)&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;When my code runs on a file path like "var/mobile/Containers/Data/Application/F343D1DB-5FBC-488C-919A-6A6893944420/Documents/img_0050.jpg" I get the output "File Exists? false File Size? 0" in iOS.&amp;nbsp;When I list the files in &lt;SPAN&gt;"var/mobile/Containers/Data/Application/F343D1DB-5FBC-488C-919A-6A6893944420/Documents" to the console using the&amp;nbsp;&lt;/SPAN&gt;FileFolder object I can see that&amp;nbsp;&lt;SPAN&gt;img_0050.jpg is there but even the&amp;nbsp;FileFolder.exists() method returns false.&lt;/SPAN&gt;&amp;nbsp;How can I fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2019 20:39:34 GMT</pubDate>
    <dc:creator>ChristopherEby2</dc:creator>
    <dc:date>2019-03-28T20:39:34Z</dc:date>
    <item>
      <title>AppStudio FileInfo Not Working on iOS 12</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873681#M3394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am testing my AppStudio 3.3 beta app on a 6th Gen iPad running iOS 12. In my code I am trying to access a file using the AppFramework.FileInfo object to verify that the file exists and then read its size. However, the code that works on Windows does not work on iOS. Here is my code:&lt;/P&gt;&lt;P&gt;function checkFile(filePath) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var fileInfo = Qt.createQmlObject('import ArcGIS.AppFramework 1.0; FileInfo { filePath: "' + filePath + '" }', app);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log('File Exists?', fileInfo.exists, 'File Size?', fileInfo.size)&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;When my code runs on a file path like "var/mobile/Containers/Data/Application/F343D1DB-5FBC-488C-919A-6A6893944420/Documents/img_0050.jpg" I get the output "File Exists? false File Size? 0" in iOS.&amp;nbsp;When I list the files in &lt;SPAN&gt;"var/mobile/Containers/Data/Application/F343D1DB-5FBC-488C-919A-6A6893944420/Documents" to the console using the&amp;nbsp;&lt;/SPAN&gt;FileFolder object I can see that&amp;nbsp;&lt;SPAN&gt;img_0050.jpg is there but even the&amp;nbsp;FileFolder.exists() method returns false.&lt;/SPAN&gt;&amp;nbsp;How can I fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 20:39:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873681#M3394</guid>
      <dc:creator>ChristopherEby2</dc:creator>
      <dc:date>2019-03-28T20:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: AppStudio FileInfo Not Working on iOS 12</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873682#M3395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that I was missing a leading slash that is necessary on iOS. Here's what I did to fix it:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;function checkFile(filePath) {&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp; &amp;nbsp;var slash = Qt.platform.os === 'ios' ? '/' : '\\';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var fileInfo = Qt.createQmlObject('import ArcGIS.AppFramework 1.0; FileInfo { filePath: "' + slash + filePath + '" }', app);&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log('File Exists?', fileInfo.exists, 'File Size?', fileInfo.size)&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Is there a cleaner way to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 21:28:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873682#M3395</guid>
      <dc:creator>ChristopherEby2</dc:creator>
      <dc:date>2019-03-28T21:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: AppStudio FileInfo Not Working on iOS 12</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873683#M3396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of useful properties and methods on the &lt;STRONG&gt;AppFramework&lt;/STRONG&gt;&amp;nbsp;object, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;AppFramework.userHomeFolder -&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#userHomeFolder-prop" title="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#userHomeFolder-prop" rel="nofollow noopener noreferrer" target="_blank"&gt;AppFramework QML Type | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;AppFramework.fileFolder -&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#fileFolder-method-1" title="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#fileFolder-method-1" rel="nofollow noopener noreferrer" target="_blank"&gt;AppFramework QML Type | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;AppFramework.fileInfo -&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#fileInfo-method-1" title="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#fileInfo-method-1" rel="nofollow noopener noreferrer" target="_blank"&gt;AppFramework QML Type | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, while we're at it, there is a useful method on the&amp;nbsp;&lt;STRONG&gt;App&lt;/STRONG&gt; object itself,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;app.folder -&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-app/#folder-prop" title="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-app/#folder-prop" rel="nofollow noopener noreferrer" target="_blank"&gt;App QML Type | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;checkExists&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fileName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; app&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fileExists&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fileName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// app.folder will be a FileFolder object for your app, e.g. /var/mobile/Containers/Data/Application/F343D1DB-5FBC-488C-919A-6A6893944420/Documents&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// then you just call fileExists('img_0050.jpg')&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appstudio-fileinfo-not-working-on-ios-12/m-p/873683#M3396</guid>
      <dc:creator>StephenQuan1</dc:creator>
      <dc:date>2021-12-12T10:56:42Z</dc:date>
    </item>
  </channel>
</rss>

