[Javascript] Forward image via http with ajax

Terry Riegel riegel at clearimageonline.com
Thu Feb 1 20:01:05 CST 2007


On Feb 1, 2007, at 8:51 PM, Paul Novitski wrote:
> 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!

Ahhh discovering the possible is much easier than the impossible :)

This is not what is happening though. The image is something like...
http://192.168.1.26/image.cgi
So it is being loaded off of the local network (not the internet)


> 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!

And it is successfully loading into the web browser (i.e. I see it).  
I don't know if that means it is a DOM element. If it is how do I  
encode it and send it? Even rough untested code would be helpful.

Thanks






More information about the Javascript mailing list