Adding a client image to a page

D

dcaveney

Is there any way to replace the "src" attribute of an <img> element
with the name of a file on the client (obtained by a <input
type="file"...> element, for example) in such a way that the page then
displays the client's image. Without uploading the specified file to
the server, is there any way to render the client's image in a page
that originates from a remote server. An attempt that DOESN'T work is:

<body
onload="javascript:document.getElementById('myImage').src='file://c:\\yourImage.jpg';">
<img id="myImage" />
</body>

....but hopefully illustrates what I'm trying to do.
 
R

Randy Webb

(e-mail address removed) said the following on 1/1/2007 12:45 PM:
Is there any way to replace the "src" attribute of an <img> element
with the name of a file on the client (obtained by a <input
type="file"...> element, for example) in such a way that the page then
displays the client's image. Without uploading the specified file to
the server, is there any way to render the client's image in a page
that originates from a remote server. An attempt that DOESN'T work is:

<body
onload="javascript:document.getElementById('myImage').src='file://c:\\yourImage.jpg';">
<img id="myImage" />
</body>

...but hopefully illustrates what I'm trying to do.

No.
 
E

Evertjan.

Randy Webb wrote on 01 jan 2007 in comp.lang.javascript:
(e-mail address removed) said the following on 1/1/2007 12:45 PM:

No.

Yes, that he is trying to do what is not possible without compromizing the
web security settings of the browser.

Further, that he has not read the FAQ entry about "javascript:

Further, that he does not know that onload="" reads javascript by default.

A fine illustation IMHO.

And that the client can see his/her own image in any mirror,
not needing javascript activated at all.
 
S

Si Ballenger

Randy Webb wrote on 01 jan 2007 in comp.lang.javascript:


Yes, that he is trying to do what is not possible without compromizing the
web security settings of the browser.

Further, that he has not read the FAQ entry about "javascript:

Further, that he does not know that onload="" reads javascript by default.

A fine illustation IMHO.

And that the client can see his/her own image in any mirror,
not needing javascript activated at all.

Did somebody wake up on the wrong side of the canal this
morning??? ;)
 

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

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top