Page 1 of 1

Help to config ZM to upload videos to Dropbox

Posted: Tue Jul 12, 2011 9:21 pm
by PacoLM
Hi,

I had ZM configured to send an email of every event using a filter. Everything worked fine until Gmail decided to limit the mail sent ratio, so my system was detected as spammer and no mail was accepted!. Now, I'm looking into uploading the videos to a dropbox account. I have found this link http://jaka.kubje.org/projects/dropbox-uploader/, where there is a php function to allow upload the file. My question is: how could I call this function from python?. I would like to call the upload function from the zmfilter.pl, do you know if its possible?.

Regards,

PacoLM

Re: Help to config ZM to upload videos to Dropbox

Posted: Wed Jul 13, 2011 9:31 am
by kross
Can't you just run a script that copies the events to your dropbox folder, and let the dropbox daemon handle uploading it?

Re: Help to config ZM to upload videos to Dropbox

Posted: Wed Jul 13, 2011 10:14 am
by PacoLM
Hi,

Well, I do not know if it's that easy. My ZM system runs in a guruplug (debian arm based), so I believe that there is no distribution made for this architecture.

PacoLM

Re: Help to config ZM to upload videos to Dropbox

Posted: Wed Jul 13, 2011 11:25 pm
by kross
Well, to answer your original question, how to call php from python, php scripts can be run from the command line, like python scripts (you need the php5-cli package installed). They don't need to be hosted in a web server. So write a small php script that takes as a command line argument the filename you want to upload. Then from your python script, execute the php script (using the os.system() function call), passing the filename that you want uploaded.