From: "Hal E. Fulton" Date: 2002-09-19T07:29:01+09:00 Subject: Semi-OT: Web issues There's a disturbing absence of Ruby code in this post, but it's somewhat on-topic as I intend to write a Ruby app for this. I've been playing with CafePress.com lately. This is an "on-demand" printing place that lets people upload their images and put them on mugs, frisbees, clocks, shirts, and so on. If you want to look at my problem in any detail, you'll have to spend five minutes signing up for a free store. The relevant portions of the site require a login. And no, I don't blame you if you don't bother. The process is all web-based and a little clunky. I've thought about writing a tool to assist. They have a page where all your graphics are stored, called the "image basket." To add a graphic, you browse to it on your hard drive and it's uploaded. Difficulties: 1. First of all, it won't work if your login times out. I'm not even certain how it knows you're logged in. With any luck, it's some kind of timestamped token on the server end. If it's a cookie on my end, that would complicate my code. 2. I started by taking the image-upload HTML and stripping it to its bare minimum. However: This "bare minimum" doesn't work. (Even when I've just logged in via the browser.) I tried using Javascript to fiddle with the referrer, thinking it might be checking that. No luck so far. HTML shown below. Of course, what I'd really like is just a little Ruby method that will take a local filename and upload it programmatically. (I hate that word. But you know what I mean.) Cheers, Hal
I agree to the statements made above.
Image File