DropBox File Uploader
It’s been several months since I’ve started learning programming and my go to language is Python. The first project I made was a snake game (which I’ll write about some other time) and the second one was a DropBox File Uploader.
So the App basically uploads files from a source folder from the computer to the target folder created in DropBox. The paths aren’t hard coded so they can be changed from the configuration file.
The first block basically goes through the source directory and uploads each file if the size of it is less than the max chunk size (DropBox API can upload a file in one shot if it’s up to 150 MB). I’ve set the max chunk size to 2 MB since I have a poor internet connection where I live.
The second block creates an upload session if the file is larger than the max chunk size. It basically divides the file into smaller chunks of 1 MB (which can be changed from the configuration file) and then uploads the file in chunks. I’ve configured fluentd and all the errors are logged in a file (pretty messy but I’ll work on it) in the td-agent. I’ve also scheduled the App with CRONTAB so the app runs in the background
For you to use this app you will need to create a developer’s account in DropBox and then generate an access token for it. The access token can be pasted in the configuration file.
Link for the App