any way to submit an image as part of a form (Javascript?)

I would like to submit the data of a rendered image from the users browser in a form. Is this possible? (My reasons are not illegal, by the way). I'm going to be storing it in a database for viewing at another time.

I know this question begs the question why not do it some other way etc etc, and may get me some "What are you trying to achieve?", but I would appreciate a straight answer.

itsastickup wrote:

I would like to submit the data of a rendered image from the users browser in a form. Is this possible? (My reasons are not illegal, by the way). I'm going to be storing it in a database for viewing at another time.

Ahh, I see. "Judge, I did not violate that person's copyright--all I did was copy it for viewing at a later date." lol.

Ahh, I see. "Judge, I did not violate that person's copyright--all I did was copy it for viewing at a later date." lol.

The site from which this will happen has explicit permission for copying of images.

If you had taken my word for it instead of presuming I would not be posting this message.

Presumption is the sign of a person who has not reached maturity but presumption in the face of a person's word is absurd.

do you mean you'd like to allow users to upload images?

-eric

"I would like to submit the data of a rendered image"

What do you mean by "rendered"? Was the image generated via Flash or something similar? If so, then the flash applet can just submit a POST request (multipart/form-data) with the image as a string. Otherwise, you'll need to clarify exactly what you're trying to do, as it sounds like you're just trying to upload an image (which due to browser security, *cannot* be done with javascript).

Hi Eric and pharington,

I'm not certain what you mean by "upload an image" and I don't mean an upload from the user's own harddisk as with an edit box for the path etc.

So to clarify: rather I supply the user with a form that has an 'img' tag to an image on another site and which the user can see (rendered). If the user submits the form I get the server to itself fetch the image from the other server but I am exploring the possibility of directly uploading what is in the client's browser to my rails server avoiding that second fetch from the other server. It won't save my rails server bandwidth but it will save the other server.

I suspect you've already answered my question with the 'javascript security' mention, but I'm not sure.

Am I'm stumbling over the cross-site restrictions, irrespective of javascript, and that there is no way of doing this?

I've been thinking about my previous post and have concluded I owe you an apology for exactly the crime I accused you of: presumption. You'll see I presumed upon your motive for posting, which may have just been humour rather than a snide remark. Looks like I;m the immature juve after all.

So sorry for that.