Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 61

AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
02/16/16 03:35 PM (8 years ago)

Save to applications document folder!

I'm working on a plugin that would allow me to create custom text files from within the console for my self hosted server, similar to bt_custom_html plugin that allows you to create an html file. My question is how can I save the text files that I create within the console to the applications document folder similar to the bt_custom_html plugin?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/16/16 08:48 PM (8 years ago)
Typically that is the kind of file kept in 'BT_Docs'. But if those documents are created 'after' the app has been compiled and released, then you actually 'can not' save a file to the app bundle... Once the app is compiled, signed, and submitted, no changes will ever occur 'within' the app. But you can save data to the App Cache. The App Cache is a 'semi volatile' place for documents. Documents will stay there until the user (or other action) clears the app cache. After the cache is cleared, a user must relaunch the app, and any files not in the bundle will need to be downloaded again. Access to the file from code isn't a big deal, but it needs to be mentioned that there are distinct methods to read from bundle, and read from cache. look in BT_filemanager.h (for iOS) and/or BT_fileManager.java (for Android) to get a list of methods used to read various files from the bundle, or from cache. Cheers! -- Smug I may have mis-read your question. If you're talking about the Applications directory of your self hosted (or BT Hosted) server, then I'd check the custom_html plugin to see what method they're using to save to the server, and replicate those methods. The path will look a little convoluted because it includes the App GUID as part of the file path, but it should work out ok.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/19/16 02:29 PM (8 years ago)
I'm not sure if it can help, but a while back I wrote an upload script that will allow multiple files to be uploaded to your BT app directory... The BT Default was one file at a time, and I wanted to 'bulk upload' a bunch of files to save time... If the script will help, you might be able to modify it to some different purpose. The methods and paths are all ready, you'll just want to change them to something particular to your needs. https://www.marianasgps.com/public/index.php Look for 'SmugUp.zip'. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.