Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a script somewhere that will allow me to upload files to an project? I'd like to be able to simply run a script on a folder and have it upload and then spit out a list of URLs, for free, permanent, file hosting.

share|improve this question

closed as off-topic by Braiam, NikTh, Eric Carvalho, Avinash Raj, Maythux Feb 15 '14 at 7:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – Braiam, NikTh, Eric Carvalho, Avinash Raj, Maythux
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

Actually, I should have spent about 30 more seconds on Google ... says I can use the s3cmd tool: sudo apt-get install s3cmd And then edit the configuration file, so ~/.s3cfg looks like:

host_base =
host_bucket = %(bucket)
access_key = key
secret_key = key
use_https = False
verbosity = WARNING

Then use the following script to upload everything to

BASE_HEADER=something-$(date -u +%s) #something that should be unique
echo Converts to PDF and uploads the contents of a directory given as the command-line argument.
echo Now converting PDF to JPG
for file in `ls $1/*.pdf`
   convert $file `echo $file | sed 's/\.pdf$/\.jpg/'`
echo Listing JPGs: #make sure the conversion worked
ls $1/*.jpg
echo Making the bucket...
s3cmd mb s3://$BASE_HEADER
echo Sleeping...#sometimes it takes a moment to be processed on their end
sleep 20
echo Uploading files...
for file in `ls $1`
        s3cmd put $1/$file s3://$BASE_HEADER/$file

It's run like ~/stuff/

share|improve this answer
(The converting to JPG was for the specific project I'm working on.) – AVB Mar 31 '11 at 2:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.