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

jeremyheslop’s picture

Assigned: Unassigned » jeremyheslop

You 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.

jethro’s picture

Status: Active » Closed (fixed)

Thanks for the quick response. That worked like a charm.