uploading a file via POST with Net::HTTP

  • Thread starter thomaslockney.12367860
  • Start date
T

thomaslockney.12367860

I've tried looking all over the place for some example of uploading a file
with Net:HTTP, but have finally given up and must ask for help.

Maybe this
is obvious or has been answered before (I tried searching the archives, but
the search form didn't seem to work for me).

Any help or pointers would
be appreciated.

Thanks,
Thomas
 
J

James Britt

I've tried looking all over the place for some example of uploading a file
with Net:HTTP, but have finally given up and must ask for help.

Maybe this
is obvious or has been answered before (I tried searching the archives, but
the search form didn't seem to work for me).

Any help or pointers would
be appreciated.

I haven't more than glanced at this (my stack keeps growing), but it may
be what you are looking for:

Ruby Flickr Upload Script (by Bill Stilwell)
http://www.deftcode.com/archives/ruby_flickr_upload_script.html

"The actual development of the script was fairly easy: ruby’s built in
support for option parsing, YAML, and XML made things simple. The only
irritating part was the HTTP POST of the image file, which I found is
not supported by the ruby’s (otherwise excellent) standard http lib. (In
case you think this an unreasonable expectation, perl does this.) A
rousing bout of googling lead me to this*, which I used to extract a
reasonably generic multipart/form-data helper class."

* http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/113774

James

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top