Skip to content

Instantly share code, notes, and snippets.

@photo
Created October 9, 2011 19:39
Show Gist options
  • Save photo/1274061 to your computer and use it in GitHub Desktop.
Save photo/1274061 to your computer and use it in GitHub Desktop.
Upload all photos from a directory using command line (openphoto-php - https://github.com/openphoto/openphoto-php)
#!/bin/sh
source secrets.sh
for i in $(ls /path/to/directory/*.JPG) ; do
./openphoto -h yourhost -e /photo/upload.json -F "photo=@$i" -X POST;
done
@jdeproost
Copy link

This is great, but would it be possible to add tags optionally at the same time? So all the uploaded photos are linked with the provided tags?

@jmathai
Copy link

jmathai commented Oct 10, 2011

Just add tags as another parameter

./openphoto -h yourhost -e /photo/upload.json -F "photo=@$i" -X POST -F "tags=tag1,tag2";

@jdeproost
Copy link

jdeproost commented Oct 11, 2011 via email

@tommyla
Copy link

tommyla commented Sep 12, 2012

use folders as tags and albums

so if you have a
"Vacation 2012" folder
then it will be album "Vacation 2012" and all pictures inside it has the tags "Vacation,2012"

@Bunchheang
Copy link

I like this www.qoosi.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment