Hi, as a ive recived lots of requests about Dropbox API for managing remote files, started coding a lua module for DropBox support using my .net integration. Module needs .net framework 4 to run as its required by official dropbox api. Also this module is compatible with any lua 5.1, luajit x86, not just AMS projects.
All methods return as first value an exception that will be nil in case of success or a text explaining the exception in case of failure.
Documentation of methods:
Load the module by using require.
Make sure you put DropBox.dll in your scripts path and the others in the exe path (cd_root)
err = DropBox.Setup(token)
This function is needed to be called after anithing else, pass to it the oauth token generated on dropbox developer app.
err, id, country, email, name, avatar_url = DropBox.GetAccount()
This function returns info about the account.
err, files, count = DropBox.GetFolder(folder_path)
This function returns a table of files on some path. for home path use an empty string "" instead a slash "/".
The files table returned should have members string "Name", bool "isFolder", string "Path" for example, files.Name
err = DropBox.Delete(file)
This function deletes a file from dropbox
err = DropBox.Upload(local_file, remote_file)
This function uploads a local file to dropbox
err = DropBox.Download(remote_file, local_file)
This function downloads a file from dropbox to a local file
err = DropBox.CreateFolder(path)
This function created a folder on dropbox
err, link = DropBox.GetTempLink(path)
This function return a link for a dropbox file that can be downloaded.
err = DropBox.Rename(path_from, path_to)
This function renames a file or folder on dropbox
err = DropBox.Copy(path_source, path_dest)
This function copies a file on dropbox
err, files, count = DropBox.Search(path, search_query)
This function has same return as GetFolder, but allows to search by some text pattern.
DOWNLOAD + SOURCE CODE