Create a Directory under Library/Caches in PhoneGap iOS Application - mobile

I can put my data in directory of Documents folder of App, but it has been rejected from Apple for reason of not follow the iOS Data Storage Guidelines.
Trying to figure out how to create a directory under Library/Cache in iOS on the file system using PhoneGap.
I want to create a directory for my PhoneGap application, so I can store images and JSON data user synced from server.

When I use window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);, it save my file to Documents folder under my App, so I got Apple rejected. The reason is the system backup all data under Documents folder to iCould after iOS6, so Apple does not allow big data like images or JSON file which could sync from your server again to keep in this folder.
So I use LocalFileSystem.TEMPORARY instead. It does not save the data to Library/Cache, but it save data to temp folder of App, which does not been auto backup to iCloud and not auto deleted either. Finally, my application has been passed Apple review.

Related

How do i make sure all the data from database won't disappear after i delete the existing folder of woocommerce plugin?

This is the error that I get in WordPress
"YITH WooCommerce Wishlist is enabled but not effective. It requires WooCommerce to work.
.
.
Destination folder already exists....../wp-content/plugins/woocommerce/"
The problem is that the woo-commerce plugin does not exist in WordPress, however, the physical file in Cpanel exists. I wonder if I delete the file I could still save the data within it.
Take a backup of the woocommerce folder and then try removing it, and check YITH WooCommerce Wishlist, I hope you have uploaded woo folder through ftp.
Backup will not let your data lost.

How do file objects get stored uploaded from a website

What design is used to store file objects that gets loaded from a website. For instance if I have a website that accepts documents or images. So
Use Case 1.
Users logs in and selects a MS word file on his machine and uploads to the website.
Use Case 2.
User logs in and selects a image on his machine and uploads to the website.
How do I store these file objects in the database
The first step is just getting the file from the AngularJS application to the server. This page talks about sending request to the server from the client and should get you started.
Once you have done that, (assuming you are using PHP) you will need to save the resulting file to the database. This post will get you started with saving files to PostgreSQL, but the details will end up being very specific to your situation:
If you have more questions after reading through those resources please add specific details about your setup to your question.

From Drive to Blobstore using Picker

I have the Google picker set up, as well as Blobstore. I'm able to upload files from my local machine to the Blobstore, but now I have the Picker set up, it works, but I don't know know how to use the info (url? fileid?) to then load that selected file into the Blobstore? Any tips on how to do this? I haven't been able to find much of anything on it on Googles resources
There isn't a direct link between the Google Picker and the App Engine Blobstore. They are kind of different tools for different jobs. The Google Picker is designed as an end user tool, to select data from a users Google account. It just so happens that the Picker also provides an upload interface (to Google Drive) as well. The Blobstore on the other hand, is designed as a blob storage mechanism for your App Engine application.
In theory, you could write a script to connect the two, but there are a few considerations:
Your app would need access to the users Google Drive account using OAuth2. This is necessary, as the Picker API is a client side API, whereas the Blobstore API is a server side API. You would need to send the selected document URL to the server, then download the document and finally save it to Blobstore.
Unless you then deleted the data from Drive (very risky due to point 3), your data would be persisted in 2 places
You cannot know for sure if the user selected an existing file, or uploaded a new one
Not a great user experience - the user things they are uploading to Drive
In essence, this sounds like a bad idea! What is your use case?
#Gwyn - I don't have enough reputation to add a comment to your solution, but I had an idea about problem #3: You cannot know for sure if the user selected an existing file, or uploaded a new one
Would it be possible to use Response.VIEW to see what view they were using when the file was selected? If you have one view constructor for Drive files and one for Upload files, something like
var driveView = new google.picker.View(google.picker.ViewId.DOCS);
var uploadView = new google.picker.DocsUploadView();
would that allow you to know whether the file was a new upload (safe to delete) or an existing file (leave it alone)?
Assuming that you want to pick a file from your own Google Drive and move it to the Blobstore.
1)First you have to perform Oauth for Google Drive API
2)Using the picker when you select a file from drive, you need to get it's id
3)Using the id obtained in step 2 you can programmatically download it using Drive API
4)After downloading the file you can use FileService(deprecated though) to upload the file to the
Blobstore.

Delete files if the user uninstall the application in Blackberry

I need to store some data in my Blackberry application so I'm using files, I'm storing these files in the internal memory of the device, but if I uninstalled the application I need these files to be removed too.
Is there a way to store the files in the same path of the application package , or any other way to delete them if the application was uninstalled?
This is the path which I'm using:
try {
fileconn = (FileConnection) Connector.open("file:///store/home/user/data.txt");
}
What kind of data are you storing? If you can store the data in the app's PersistentStore instead, it will automatically be deleted when the app is uninstalled.

How to embed a SQLite DB (*.db file) to the AIR application?

I want to emded SQLite database (*.db file) to the AIR app, like images, mp3 etc.
This is to ensure that it was impossible to copy my database for other users.
No, you can't. And even if you could package it, the data wouldn't really be protected: since an .air package is in essence nothing more than an enhanced .zip archive, anyone could just extract the database from the .air file.
What you have to do is encrypt your database and protect it with a password so that only authorized users can access the database.
There's ample documentation on how to do this. Here's a tutorial from Adobe to get you started: http://www.adobe.com/devnet/air/flex/quickstart/articles/encrypted_database.html
I think this is not possible. If you embed it to the air file andinstall the AIR app the db will be copied to the installation folder.
You could create the database in the user storage location
var file:File = File.applicationStorageDirectory.resolvePath("name.db");
Users could still navigate in explorer to the file. It will be stored under /users/username/appdata/appname/Local Store
AppData is a hidden folder.

Resources