Where to store json file in ionic for ios? - ios

I need to ship my application with a json file. The angular code then needs to read the json file and output the result into a view. I am very new to ionic and looked at the cordova-plugin-file plugin, but I am still not sure where to upload the file in my project. So the issue is that I don't know where to upload the file and how to read the same file. Any help or example code is appreciated.

I found the answer in the following post:
http://www.raymondcamden.com/2014/07/15/Cordova-Sample-Reading-a-text-file

Related

Where is the swagger json schema located?

The help for swashbuckle mentions that the ui for Swagger is driven by the generated json schema.
Where is this json file located?
I cannot find it in the folder for my asp.net project
When I actually run the application and navigate to http://localhost:51659/swagger/v1/swagger.json
then I see the json
Where is it on disk? Or is it only in memory?
There is no file generated, it is only on memory.
You might want to read a bit the code:
https://github.com/domaindrivendev/Swashbuckle/blob/master/Swashbuckle.Core/Swagger/SwaggerGenerator.cs
If you need a file you could create an IDocumentFilter to generate one. I have an example here generating a Yaml file:
https://github.com/heldersepu/Swagger-Net-Test/blob/master/Swagger_Test/App_Start/SwaggerConfig.cs#L378

Reading an excel file using cordova in ios

I am currently working on a hybrid app for iOS. I am using Ionic/Cordova to make it. It's my first time using it.
I want to be able to read an xlsx file that is currently on my iPad and show that data in my app in a table format. I have read about the ngCordova file plugin at http://ngcordova.com/docs/plugins/file/. I have also read about AlaSQL.js at https://github.com/agershun/alasql. Can I use these together to do my task? Or should I use one over the other?
I find the documentation for the file plugin to be a bit confusing. Can someone give me a pointer or example of accessing the file and outputting it?
Thanks!
try to use file plugin to retrieve directory list and fileOpener2 plugin to open xlsx file.

ionic framework / cordova IOS : open local file - local file path

I'm trying without success to open some local files with the CordovaFileopener2
Can somebody post a sample of code on how generate a local file path?
I need for example to point www/pdf/document1.pdf
Thanks a lot for your help
Alfonso
Hi I have uploaded a sample project for file Transfer in git hub
Please have a look and reply, if you have any queries

Uploading file revisions with Dropbox Core API in Xcode

I am having a lot of trouble syncing file revisions to dropbox with the "withParentRev" parameter in "uploadFile."
Basically, I export information to a .pdf file. I want to upload the .pdf to dropbox, and if it's a new file it should upload it with "withParentRev=nil," but if the file exists then it should get the revisions. I have tried using loadMetadata on the file, but because the dropbox calls are synchronous I am having trouble uploading the right files.
No one else seems to have good sample code on how to do and any help would be greatly appreciated!

Exporting files from a Javascript based phonegap app - options or ideas?

I'm currently writing a mobile app (hopefully iOS or android) using the jquery mobile framework and phonegap.
It'll need to export/send csv files in some way to the users, but I'd be interested to hear ideas or suggestions about the best way of doing so. If this can be done on the js side of the app that'd be ideal as it's what I'm most familiar with. A couple of options I've considered are:
Uploading the file using the google docs api
Writing the file to the file system (then export e.g. via iTunes)
I'm new to this so any suggestions gratefully received! Thanks for your help
There are a few options that you could use depending on how you want it to work.
The main options would be to
Use the File API (http://docs.phonegap.com/phonegap_file_file.md.html#File) to store files on the filesystem of the device.
Upload the file to a server using a standard XMLHttpRequest.
Write a native PhoneGap plugin on each platform that you are interested in that could connect to Google docs.
As Dave pointed out you can write files with the FILE API. I have used the file api on iOs to write custom log files and havent found any yikes so far.

Resources