Issues with 'upload to Dropbox' in App using "AntonioCiolino / DropBox.lua" code

Dear forum,

I am nearing completion of an App that allows a user to draw plans of a building and upload the data to dropbox / local storage. All work I am doing is pro-bono as part of my academic research. Without saying too much - this App will be used to help sick kids living in lower socio-economic conditions, so I think it is worthwhile for anyone reading to consider the following issues. I thank everybody on this forum for the tremendous help they have imparted.

I am currently using Ciolino code to speak to dropbox. Currently, I have managed to get the App to authenticate with dropbox and deliver files to it.

However there are some issues that I want to ask the forum about :

  1. When exporting - the App requires going to externally to authentic, then switching back to codea to finish the two step process. Is there a simpler procedure?

1.5) The dropbox code uses Auth1 which I have read is the ‘older’ version, the current version is auth2(?). I am concerned this may affect the running of this App in the future, the duration of the trials will go until 2016/2017 so this cannot break. If there is anyone more knowledgeable around this area please advice.

  1. There are a lot of strange things happening when trying to authenticate with dropbox, for example : sometimes it does not go to the correct authentic screen but goes to the dropbox sign in screen instead, which breaks the upload procedure. I suspect these strange things are affected by the current state of the dropbox account (whether logged in already or not etc)

  2. I am having success uploading the default files in the original code, but I cannot find the part of the code that I can paste my own data into, so that it uploads that instead.

  3. I am having difficulty writing code that checks for validation of a successful data transfer, this is very very important as hundreds of hours could be potentially wasted in the real world trial runs if the data does not go through properly. I think my coding skills at the moment are not sufficient to do this part, any help is appreciated.

  4. reserved for further questions


I posted a modified version earlier today. It does the oauth easier. You can put your dev key and token when it loads the dropbox info and any device you load it into can then authenticate.

To check for validation you can get Meta info for the location which will tell you if the file exists.

Hello Briarfox, could you link me to the revision? It is not coming up on google, cheers.

@Briarfox I’m getting this error when using Write()

[string "--DropBox..."]:99: You must create a new request and authorize before accessng DropBox information.

Edit: No worries created a new app and dropbox authorised properly.

@Luatee looks like you tried to send a request and didn’t authorize.

@briarfox the updated db api is so much simpler. Thank you!

@briarfox Dropbox is now working on my app :slight_smile: There is one concern though, if for some reason I go to the DB authenticate screen and press ‘Done’ too quickly, it crashes the App, resulting in lost of all data. Is there a way to stop this from happening?

@archistudent I’ve never had it crash Codea. If you click “done” to fast it may fail to finish auth but I’ve never had it crash. You should only have to authenticate once. Have the user authenticate before you start working with any senesitive data to avoid the possibility of loss.

@briarfox Ah scratch that, I reread your reply and completely understand what you mean now. Yes - authenticating before any data is entered is the most logical step, will implement that tomorrow. The dropbox api works like a charm right now.

Part 1-4 of my questions have been solved. However can you give me more suggestion on how to use meta data to validate that the data has been successfully uploaded to dropbox?

Thanks, YK