From: Andrew Date: 2003-04-08T14:32:35+09:00 Subject: sending a file via http Hello, I'm trying to send a file using http in a ruby script of mine. I've been trying to find an answer for this, but haven't been satisfied with anything I've seen so far. What I'm doing is this... I've got a file on my host machine (no direct link to it from the web page--and I don't want one) and the user is clicking on a link invoking my ruby script which in turn attempts to send the file to the client. This is what I have so far... .... file = File.open("data.zip") puts "Content-type: application/x-zip-compressed\n" puts "Content-length: "+File.size("album.zip").to_s+"\n\n" ok, now what? How do I send the file data? I can send plain text no problem, but I don't know how to efficiently send this file. Any help would be appreciated. Thanks, Andrew