Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
kwjamesblond
8 years agoExplorer | Level 4
How to only upload newest file with python 3?
Hello I am working on an app and have developed code for uploading video that I have taken with a camera setup. The problem I have been facing is that using python 3 I am only capable of uploading a...
kwjamesblond
8 years agoExplorer | Level 4
In an effort to keep things as simple as possible I have added two lines of python code that scans and save the newest file in the folder than saves it to a varible. Next I added some basic code to upload the file to dropbox but I am running into two problems. The main issue is while the files are uploaded and show up on dropbox they are not completly uploaded and cannot be played and I think they are corrupt. The other issue is I am unable to preserve the filenames which is important becuase I added a timestamp to the video names to easily record when they were filmed.
allfiles = glob.glob('/home/pi/Documents/CameraFeeds/*')
newestfile = max(allfiles, key=os.path.getctime)
dropbox_path = os.path.join('/*')
with open(newestfile, 'rb') as f:
dbx.files_upload(f.read(), dropbox_path, mute=True)
Greg-DB
Dropbox Community Moderator
8 years ago[Cross-linking for reference: https://stackoverflow.com/questions/48600061/simple-code-to-upload-a-video-to-dropbox-with-python ]
It looks like you already got this sorted out using upload sessions in your StackOverflow post.
It looks like you already got this sorted out using upload sessions in your StackOverflow post.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!