[Javascript] Forward image via http with ajax

John Warner john at jwarner.com
Sat Feb 3 15:24:43 CST 2007


I agree with Scott, if the list is correct (no reason to think
otherwise) then this is not possible. You will need to capture the image
on a computer/device on the LAN and ftp to the server or some similar
arrangement (http). No way the webserver can see the camera as currently
configured. No way the browser can hold an image in memory (itself,
Windows clipboard could do this) and then visit another site and upload
an image. Now this process can be automated, that is capturing the image
and passing it off the LAN, but not via JavaScript in a browser.
Assuming the computers on the LAN are Windows, Windows Script Host can
do this with no problem and in the background such that the user of the
computer is barely aware or not at all. Actually easier with a .NET app
or Java, but WSH can get the job done with no additional software needed
on the chosen Windows computer on the LAN. I would actually use ftp for
the job.  But the details since they wouldn't be JavaScript edge off
topic.

John Warner


> -----Original Message-----
> From: javascript-bounces at LaTech.edu 
> [mailto:javascript-bounces at LaTech.edu] On Behalf Of Scott Reynen
> Sent: Saturday, February 03, 2007 3:10 PM
> To: [JavaScript List]
> Subject: Re: [Javascript] Forward image via http with ajax
> 
> 
> On Feb 3, 2007, at 12:52 PM, Terry Riegel wrote:
> 
> > 1. IP camera (LAN)
> > 2. Web Browser (LAN)
> > 3. Router (gateway between LAN and WAN)
> > 4. Web Server (WAN)
> >
> > I need to move the image from the (1) The IP camera to (4) The Web
> > server. I am trying to do this using (3) The web browser as the  
> > agent to move it.
> 
> I believe what you want to do is impossible.  If it's not, it should  
> be, as it would allow a JavaScript to funnel content from a private  
> LAN (presumably private to prevent just such funneling) to a remote  
> server without user approval.  To avoid this kind of security  
> problem, JavaScript can only load content from servers within the  
> same domain as the JavaScript itself.  If that domain is the web  
> server (4), you won't be able to load data from the IP camera (1).   
> If that domain is the IP camera (1), you won't be able to send the  
> data to the web server (4).  If you want to steal images from an  
> unwilling LAN, I think (hope) you'll at least need a co-conspirator  
> within the LAN.
> 
> Peace,
> Scott





More information about the Javascript mailing list