Highlighted

write and open applicationStorageDirectory

Contributor ,
Aug 20, 2019

Copy link to clipboard

Copied

Hello,

I'm having trouble opening and (possibly?) writing to the applicationStorageDirectory.

When I write and then subsequently check if File.exists, it returns true.

However, when browsing the file system. I cannot find the file. The directory in the app shows nativeurl as /user/0/appid etc... but when I look for this directory using the file browser it doesn't exist. I have selected not to hide system files.

When I restart the app, again it says the file exists.

Is this directory somehow hidden?

This is confounded because I'm trying to open a pdf in android (eventually iOS too), I've tried a variety of methods and ane's all with no luck. I'm trying to confirm the file does exists, which the app says it does, however I can't open it and I can't find it using a file browser.

Any insight appreciated!

-cybo

TOPICS
Development

Views

308

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

write and open applicationStorageDirectory

Contributor ,
Aug 20, 2019

Copy link to clipboard

Copied

Hello,

I'm having trouble opening and (possibly?) writing to the applicationStorageDirectory.

When I write and then subsequently check if File.exists, it returns true.

However, when browsing the file system. I cannot find the file. The directory in the app shows nativeurl as /user/0/appid etc... but when I look for this directory using the file browser it doesn't exist. I have selected not to hide system files.

When I restart the app, again it says the file exists.

Is this directory somehow hidden?

This is confounded because I'm trying to open a pdf in android (eventually iOS too), I've tried a variety of methods and ane's all with no luck. I'm trying to confirm the file does exists, which the app says it does, however I can't open it and I can't find it using a file browser.

Any insight appreciated!

-cybo

TOPICS
Development

Views

309

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 20, 2019 0
Engaged ,
Aug 20, 2019

Copy link to clipboard

Copied

I haven't tried with PDFs before, but I do have an app that saves images to the applicationStorageDirectory using File and FileStream, then I can load the image in later using the "app-storage:/" URL scheme in a URLRequest.  I believe that's based on the File's url, rather than the nativePath.

Are you trying to open the PDF from within the same app that created/saved the PDF?  Or trying to access it outside of this app?  On mobile devices I don't believe you can actually browse to the applicationStorageDirectory since it's local to the app itself and can't be accessed by anything else.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2019 1
Contributor ,
Aug 20, 2019

Copy link to clipboard

Copied

I think you're right that the applicationStorageDirectory is hidden from the phone browser. Since when I restart the app it does return that the file exists.

Yes, I'm opening the pdf within the same app that created it. I'm actually trying to use an ANE to have a "open with" behavior to send the pdf to be opened by the device native app like reader. I haven't had any luck getting myflashlabs pdfViewer ANE to work or a free one I found on github. The myflashlabs pdfViewer gives me an "Error #1065: Variable OverrideAir is not defined." fault.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2019 0
New Here ,
Aug 21, 2019

Copy link to clipboard

Copied

@cybobear: You probably forgot to import a dependency ANE, when try to use pdfViewer from MyFlashLabs. Every of their ANEs needs at last OverrideAir ANE - https://github.com/myflashlab/common-dependencies-ANE/tree/master/overridAir - to be included in your project. (See details on pdfViewer ANE page).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 21, 2019 0
Adobe Community Professional ,
Aug 21, 2019

Copy link to clipboard

Copied

Hi.

If none of the these work for you and Internet connection is not an issue, maybe you should consider using an online PDF viewer, like the one from Google Drive.

Re: Opening PDF stored on ApplicationDirectory within iOS

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 21, 2019 0