Closed teamdenver closed 9 years ago
What operating system and version?
testing on ipadAir IOS 7.1.2 cordova 3.5 xcode 5.1.1 OSX 10.9.4
I can see the file in the Xcode organiser - Data Files in Sandbox Directoy Listing tmp folder. But the code never finds it.
EDIT "I can see the file in the Xcode organiser - Data Files in Sandbox Directoy Listing tmp folder" this may not always be true exactly its hard to tell. More like, when I ran the app again from xcode it "seemed" to find the file and return true. But never returns true when I am not connected to the mac.
If you console.log cordova.file.applicationDirectory what do you see?
cordova.file.applicationDirectory = file:///var/mobile/Applications/< ID #s>/my.app/ also cordova.file.tempDirectory = file:///private/var/mobile/Applications/< ID #s>/tmp/
obvious difference with 'private'. Some say it is just a symlink and will be treated the same. Others do not.
Do you think it is related to this? http://stackoverflow.com/questions/14992834/what-does-the-private-prefix-on-an-ios-file-path-indicate
UPDATE: Id rather use the Documents folder or Library anyway and they do not have the private in the path so Im gonna not worry weather it matters or not. so close man
To be clear, you are using which of my demos?
http://www.raymondcamden.com/2014/7/1/Cordova-Sample-Check-for-a-file-and-download-if-it-isnt-there
I am commenting on there as well for anyone not watching this git. I am AJ Davidson.
BTW window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + "www/index.html", gotFile, fail);
does return true. I must not be accessing the persistent folders in the right way.
I have a bit more info. I watched my apps sandboxed directory from the xcode organiser window. I can see the file in the Documents folder after successful transfer code. Then console says it is "copy" file to Adobe Reader Sandbox. But as soon as I choose "Open With" Adobe Reader or Mail, or Imessage etc, and refresh organiser window, it is gone. It is a "move" not a "copy". resolveLocalFileSystemURL isnt true because the file is no longer there.
Ok, I'm confused again: "Then console says it is "copy" file to Adobe Reader Sandbox." Can you explain what Adobe Reader has to do with my demo?
I updated my comment I did not mean to imply anything about reader in particular.
It doesnt matter what I choose to open the downloaded file with.
It does not persist in My apps sandbox.
So to be clear, opening it makes it move? If so, that may be a quirk of iOS. This is what I recommend. Post your question to the PhoneGap google group. Explain how you can download a file to the dataDirectory, but opening it seems to move it.
I'm asking you to do this as I believe it is outside the confines of my demo code.
Yes sir. As soon as I choose any option to "open with" another app, it is gone from my app sandbox. Not copied. And if I Do Not choose to open the downloaded file. But instead close the app and restart it. It DOES then find the file.
I will do as you suggest. I appreciate your time.
The solution was modifying the fileopener plugin code. It was in no way related to your code which was great ty.
It just downloads a new file every time. Which it does well, I thank you for that greatly. I would like to know what I am missing to open a file I know is there somewhere. Because adobe will open all of them offline. My code will not.