<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how can i upload saved or webcam images and videos on dropbox from python? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155452#M5204</link>
    <description>&lt;P&gt;i have installed python version 2.7.also i have installed required libraries like opencv and numpy.&lt;/P&gt;
&lt;P&gt;Using this library i have done image and video processing which are captured from webcam and also from existing file..these all things work fine with me.&lt;/P&gt;
&lt;P&gt;I have know how to access dropbox using python through that ACCESS TOKEN.&lt;/P&gt;
&lt;P&gt;Now i have to upload all these things- (means captured videos and images) to my dropbox account from python program.&lt;/P&gt;
&lt;P&gt;I have seached a lot for that...but i didn't get code for uploading images and videos on dropbox with the help of python.&lt;/P&gt;
&lt;P&gt;So, can anybody suggest me what is the code for the above problem.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:35:10 GMT</pubDate>
    <dc:creator>JASMINA V.</dc:creator>
    <dc:date>2019-05-29T09:35:10Z</dc:date>
    <item>
      <title>how can i upload saved or webcam images and videos on dropbox from python?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155452#M5204</link>
      <description>&lt;P&gt;i have installed python version 2.7.also i have installed required libraries like opencv and numpy.&lt;/P&gt;
&lt;P&gt;Using this library i have done image and video processing which are captured from webcam and also from existing file..these all things work fine with me.&lt;/P&gt;
&lt;P&gt;I have know how to access dropbox using python through that ACCESS TOKEN.&lt;/P&gt;
&lt;P&gt;Now i have to upload all these things- (means captured videos and images) to my dropbox account from python program.&lt;/P&gt;
&lt;P&gt;I have seached a lot for that...but i didn't get code for uploading images and videos on dropbox with the help of python.&lt;/P&gt;
&lt;P&gt;So, can anybody suggest me what is the code for the above problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:35:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155452#M5204</guid>
      <dc:creator>JASMINA V.</dc:creator>
      <dc:date>2019-05-29T09:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: how can i upload saved or webcam images and videos on dropbox from python?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155453#M5205</link>
      <description>&lt;P&gt;Version 1 of the Dropbox API for Python has a tutorial for uploading here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers-v1/core/start/python" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers-v1/core/start/python&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Version 2 of the Dropbox API for Python has one here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/python#tutorial" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/documentation/python#tutorial&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 21:56:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155453#M5205</guid>
      <dc:creator>Richard P.</dc:creator>
      <dc:date>2016-03-05T21:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: how can i upload saved or webcam images and videos on dropbox from python?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155454#M5206</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;Here is the the code for uploading live videos on your dropbox account using python in windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import numpy as np&lt;BR /&gt;import cv2&lt;BR /&gt;import dropbox&lt;BR /&gt;import os&lt;BR /&gt;from glob import iglob&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;access_token = 'paste your access token here' &amp;nbsp; #paste your access token in-between ''&lt;BR /&gt;client = dropbox.client.DropboxClient(access_token)&lt;BR /&gt;print 'linked account: ', client.account_info()&lt;BR /&gt;PATH = ''&lt;/P&gt;
&lt;P&gt;cap = cv2.VideoCapture(0)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;# Define the codec and create VideoWriter object&lt;BR /&gt;fourcc = cv2.VideoWriter_fourcc(*'XVID')&lt;BR /&gt;out = cv2.VideoWriter('C:\python27\output1.avi',fourcc, 20.0, (640,480))&lt;/P&gt;
&lt;P&gt;#here output1.avi is the filename in which your video which is captured from webcam is stored. and it resides in C:\python27 as per the path is given.&lt;/P&gt;
&lt;P&gt;while(cap.isOpened()):&lt;BR /&gt; ret, frame = cap.read()&lt;BR /&gt; if ret==True:&lt;BR /&gt; #frame = cv2.flip(frame,0) #if u want to flip your video&lt;/P&gt;
&lt;P&gt;# write the (unflipped or flipped) frame&lt;BR /&gt; out.write(frame)&lt;/P&gt;
&lt;P&gt;cv2.imshow('frame',frame)&lt;BR /&gt; if cv2.waitKey(1) &amp;amp; 0xFF == ord('q'):&lt;BR /&gt; break&lt;BR /&gt; else:&lt;BR /&gt; break&lt;BR /&gt; &lt;BR /&gt;# Release everything if job is finished&lt;BR /&gt;cap.release()&lt;BR /&gt;out.release()&lt;BR /&gt;cv2.destroyAllWindows()&lt;/P&gt;
&lt;P&gt;for filename in iglob(os.path.join(PATH, 'C:/Python27/output1.avi')):&lt;BR /&gt; print filename&lt;BR /&gt; try:&lt;BR /&gt; f = open(filename, 'rb')&lt;BR /&gt; response = client.put_file('/livevideo1.avi', f)&lt;BR /&gt; print "uploaded:", response&lt;BR /&gt; f.close()&lt;BR /&gt; #os.remove(filename)&lt;BR /&gt; except Exception, e:&lt;BR /&gt; print 'Error %s' % e&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this will &amp;nbsp;help you.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 20:04:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155454#M5206</guid>
      <dc:creator>JASMINA V.</dc:creator>
      <dc:date>2016-03-13T20:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: how can i upload saved or webcam images and videos on dropbox from python?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155455#M5207</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;Here is the code for uploading existing video on your dropbox account using python in windows.&lt;/P&gt;
&lt;P&gt;Hope this will help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Include the Dropbox SDK&lt;BR /&gt;import dropbox&lt;/P&gt;
&lt;P&gt;# Get your app key and secret from the Dropbox developer website&lt;BR /&gt;app_key = 'paste your app-key here'&lt;BR /&gt;app_secret = 'paste your app-secret here'&lt;/P&gt;
&lt;P&gt;flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)&lt;/P&gt;
&lt;P&gt;# Have the user sign in and authorize this token&lt;BR /&gt;authorize_url = flow.start()&lt;BR /&gt;print '1. Go to: ' + authorize_url&lt;BR /&gt;print '2. Click "Allow" (you might have to log in first)'&lt;BR /&gt;print '3. Copy the authorization code.'&lt;BR /&gt;code = raw_input("Enter the authorization code here: ").strip()&lt;/P&gt;
&lt;P&gt;# This will fail if the user enters an invalid authorization code&lt;BR /&gt;access_token, user_id = flow.finish(code)&lt;/P&gt;
&lt;P&gt;client = dropbox.client.DropboxClient(access_token)&lt;BR /&gt;print 'linked account: ', client.account_info()&lt;/P&gt;
&lt;P&gt;f = open('give full path of the video which u want to upload on your dropbox account(ex: C:\python27\examples\video.avi)', 'rb')&lt;BR /&gt;response = client.put_file('/video1.avi', f) #video1.avi is the name in which your video is shown on your dropbox account. You can give any name here.&lt;BR /&gt;print 'uploaded: ', response&lt;/P&gt;
&lt;P&gt;folder_metadata = client.metadata('/')&lt;BR /&gt;print 'metadata: ', folder_metadata&lt;/P&gt;
&lt;P&gt;f, metadata = client.get_file_and_metadata('/video1.avi')&lt;BR /&gt;out = open('video1.avi', 'wb')&lt;BR /&gt;out.write(f.read())&lt;BR /&gt;out.close()&lt;BR /&gt;print metadata&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now for uploading images, the same code will be used.&lt;/P&gt;
&lt;P&gt;Only write your image file name which you want to upload for ex: image.jpg in place of video name . Also change the name of video1.avi and write name for image in which your uploaded image will be shown in your dropbox for ex:image1.jpg.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 20:43:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-i-upload-saved-or-webcam-images-and-videos-on-dropbox/m-p/155455#M5207</guid>
      <dc:creator>JASMINA V.</dc:creator>
      <dc:date>2016-03-13T20:43:09Z</dc:date>
    </item>
  </channel>
</rss>

