Closed (fixed)
Project:
Viddler
Version:
6.x-1.7
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
5 Nov 2010 at 00:08 UTC
Updated:
8 Nov 2010 at 16:24 UTC
I have about 600 videos attached through filefield to nodes. I am trying to upload these videos through the api and attach to nodes, just like if they were uploaded through the nodes edit page.
How do I upload local files to viddler through the api? I've tried:
viddler_api_uploadvideo(array('sites/default/files/filename.mp4'));
with no success.
Would it be easier to use viddlers api directly? Thanks for any assistance.
Comments
Comment #1
jeremyheslop commentedYou should be able to just pass the filename as a string and not an array. The api call comments specifies an array, but I've not implemented it yet. At some point I'd like to be able to specify title, description, etc when posting to viddler.
So your line should be:
$video_id = viddler_api_uploadvideo('sites/default/files/filename.mp4');
That should work. You should get a video_id from viddler upon uploading that you can store in the viddler_field.
Remember to make sure you have all the viddler api key, username and password settings correct before running any api calls.
Comment #2
jethro commentedThanks for the quick response. That worked like a charm.