[Javascript] Forward image via http with ajax

Paul Novitski paul at juniperwebcraft.com
Thu Feb 1 19:51:07 CST 2007


At 2/1/2007 05:22 PM, Terry Riegel wrote:
>I am working with a IP camera that is able to display an image on my
>web browser (since my computer and the camera are on the same network
>intranet) I would like to push that image via javascript up to my web
>server (internet). This would allow me capture an image without
>configuring a router to port forward.


Javascript has been very deliberately designed to avoid security 
breaches such as reading & writing the client's hard drives.

What's the mechanism that brings the image to your browser?  In order 
for you to see it has it been saved as an image file to your hard 
drive?  If so, could you build an html form with a file upload 
control, seed its value with the location of the image file, and 
submit() the form?

If the ECMA folks are doing their homework, that isn't possible.  If 
you figure out how, please keep your script off my computer! as 
you've opened a nasty security loop hole.  It would mean you could 
put a script on a web page that would upload selected files from the 
client's hard drive without their knowledge or intervention.

a) Please let us know if you succeed.
b) Please discover it's impossible!

On the other hand, if the image constitutes the value of a DOM 
element, perhaps all you need to do is htmlencode the binary string 
and feed it to an HttpXMLRequest routine.

Sorry to break my own rule and make a suggestion I don't have time to 
test first.  Blow me down!

Regards,

Paul
__________________________

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 




More information about the Javascript mailing list