What's the easiest cloud solution to use?

I’m looking for a super easy to use cloud service which lets my application dump any old (smallish) file, like a json file, into the cloud and read it back. Specifically, I want this for cross-device reading - not user file storage.

So, I’m thinking something like a simple API for DropBox which my app can have a unique key to access and I don’t need to write code for - it’s all client side.

app42 comes with lua syntax and should work fine for your needs, but there are others out there as well which I havent tested.

I just upload and download JSON files to the webspace of a small website I have using Corona’s FTP functions. It goes a bit like this (warning: crudely edited copy-paste code):

local ftp = require(“ftp”)
    local connection = ftp.newConnection{
    host = “ftp.yourwebsite.com”,
    user = “username”,
    password = “password”,
    – port = 21 – Optional. Will default to 21.
    }
        
connection:upload{
    localFile = system.pathForFile(“localFileName”, system.DocumentsDirectory),
    remoteFile =  "/public_html/“remoteFileName”,
    – onSuccess = onUploadSuccess,
    – onError = onError
    }

And practically the same for download - it’s all in the docs, and super-easy.

I’m not sure why you wouldn’t just use network.request()/network.download() for this against a web server. You can setup basic authentication by simply dropping a .htaccess file in the folder.

You could look at some of @develephant’s cloud options. His API’s are all Lua based even on the server side. I’m pretty sure both PlayFab and GameSparks have file storage features.

Rob

just get a free web host and use built in APIs to set/get JSON.  name your files based on device ID to ensure uniqueness

All great options, thanks guys!

I was hoping to avoid server-side coding entirely, hence the request for a service. I’m not against any particular method of up/down-loading on the client side.

Hello Horacebury,

I just come across this, and thought that it may be relevant and useful to you. It was shared earlier by schroederapps.

AirTable: Useful Tool for Managing App Content Remotely.

https://forums.coronalabs.com/topic/73169-airtable-useful-tool-for-managing-app-content-remotely/

He also shared a module on github gist, to pull the data.

Regards, Luan

PS> I have yet to try it out. But I would keep this in mind, when needed.

Has anyone tried doing this with DropBox? I’ve checked out the API on the code exchange, but it’s way out of date now.

H,

I’ve got DropBox working in one of my apps, but I haven’t played with public access.  I’ve got it working where user’s access to the folder created by my app requires an invite from the owner of the shared Dropbox folder. Much easier for a single user as each device would only need a 1 time sign in to their existing DropBox account.

This would work for sharing  data across devices or users with permission.   The DropBox account isn’t created by the app, the user must create an account by applying to DropBox directly first, so it isn’t a seamless data share.  It does the job for may app though.

In another one of my apps, a reservation system, I use a server based mySQl database where the user creates an account and password to gain access and the app will download the json file or data from the database.  I struggled with the mySQL/PHP, I’m terrible, but have hacked out about 25 scripts to run the app.  This is the way to go IMO, unless the server space goes away and so does the users data.

I use DropBox for the one app because the user’s data is important, private and in their control, I also don’t have to pay for the file storage.

Neither method is “quick and easy” though, just say’n.

H wrote: “Specifically, I want this for cross-device reading - not user file storage”

I have to admit, you lost me with this one though.  I was assuming you wanted a user’s data to be shared across their devices.  That would be the definition of user file storage. IMO.

Nail

You should be able to use network.request() or network.download() with URL’s from Dropbox

Rob

Having found the existent DropBox API libraries out of date, I decided to write my own. You can find it here:

https://gist.github.com/HoraceBury/dd46914c0449da7e14cb380dc05766aa

Because, as noted in my original post, I didn’t want to write any server code, this is a library specifically to perform IO style W/R operations on an application’s private folder within the developer’s DropBox account. Therefore, you need only to create an app definition in DropBox, generate an access token (‘bearer token’) and go! Users of your app will not be required to authenticate and your app can upload and download files as required.

I should point out that there are a couple of other libraries required by it, linked to from within the dropboxapi.lua file on GitHub.

If you have any comments, requests or suggestions for documentation please let me know.

@horacebury

Thanks for sharing your code on this.  

I hope I can get around to playing with it and seeing if I can put it to good use in some of my apps.

Bob

app42 comes with lua syntax and should work fine for your needs, but there are others out there as well which I havent tested.

I just upload and download JSON files to the webspace of a small website I have using Corona’s FTP functions. It goes a bit like this (warning: crudely edited copy-paste code):

local ftp = require(“ftp”)
    local connection = ftp.newConnection{
    host = “ftp.yourwebsite.com”,
    user = “username”,
    password = “password”,
    – port = 21 – Optional. Will default to 21.
    }
        
connection:upload{
    localFile = system.pathForFile(“localFileName”, system.DocumentsDirectory),
    remoteFile =  "/public_html/“remoteFileName”,
    – onSuccess = onUploadSuccess,
    – onError = onError
    }

And practically the same for download - it’s all in the docs, and super-easy.

I’m not sure why you wouldn’t just use network.request()/network.download() for this against a web server. You can setup basic authentication by simply dropping a .htaccess file in the folder.

You could look at some of @develephant’s cloud options. His API’s are all Lua based even on the server side. I’m pretty sure both PlayFab and GameSparks have file storage features.

Rob

just get a free web host and use built in APIs to set/get JSON.  name your files based on device ID to ensure uniqueness

All great options, thanks guys!

I was hoping to avoid server-side coding entirely, hence the request for a service. I’m not against any particular method of up/down-loading on the client side.

Hello Horacebury,

I just come across this, and thought that it may be relevant and useful to you. It was shared earlier by schroederapps.

AirTable: Useful Tool for Managing App Content Remotely.

https://forums.coronalabs.com/topic/73169-airtable-useful-tool-for-managing-app-content-remotely/

He also shared a module on github gist, to pull the data.

Regards, Luan

PS> I have yet to try it out. But I would keep this in mind, when needed.

Has anyone tried doing this with DropBox? I’ve checked out the API on the code exchange, but it’s way out of date now.

H,

I’ve got DropBox working in one of my apps, but I haven’t played with public access.  I’ve got it working where user’s access to the folder created by my app requires an invite from the owner of the shared Dropbox folder. Much easier for a single user as each device would only need a 1 time sign in to their existing DropBox account.

This would work for sharing  data across devices or users with permission.   The DropBox account isn’t created by the app, the user must create an account by applying to DropBox directly first, so it isn’t a seamless data share.  It does the job for may app though.

In another one of my apps, a reservation system, I use a server based mySQl database where the user creates an account and password to gain access and the app will download the json file or data from the database.  I struggled with the mySQL/PHP, I’m terrible, but have hacked out about 25 scripts to run the app.  This is the way to go IMO, unless the server space goes away and so does the users data.

I use DropBox for the one app because the user’s data is important, private and in their control, I also don’t have to pay for the file storage.

Neither method is “quick and easy” though, just say’n.

H wrote: “Specifically, I want this for cross-device reading - not user file storage”

I have to admit, you lost me with this one though.  I was assuming you wanted a user’s data to be shared across their devices.  That would be the definition of user file storage. IMO.

Nail