views:

314

answers:

5

Hello all,

I have a web application (.NET, if it matters) where when one of the pages is loaded, a file on the users local machine needs to be copied (uploaded) to the webserver. This upload needs to be without user intervention. This web application will be running on a kiosk where I would be setting up the original permissions and then locked down from accessing the desktop/filesystem.

Conversely, on another page, I need the web application to copy something to the users local machine (download). Again, this download needs to be invisible to the user.

Any help would be greatly appreciated.

Many thanks in advance.

Update: Yeah, I know this could be used maliciously. I was hoping there was a way of doing this, but really, it shouldn't be allowed. Bah, thanks for confirming my suspicions.

Update 2: See comment to Guy Starbuck.

+4  A: 

Yeah, that's not possible. And that's a very good thing.

If you really need this sort of functionality you'll have to write a standard executable application, not a web one.

Chad Birch
+1  A: 

Unless Firefox has some configuration options which permit this behaviour, I think you're outta luck. Browsers do not permit user-unauthorized automatic downloads, for obvious reasons.

Blank Xavier
A: 

If I were you I'd clarify what you're trying to do here because 1) do you know of any website that does this? and 2) it sounds like you're trying to make something malicious. Just saying.

Spencer Ruport
A: 

hard to say if this would be useful, but depending on what you're trying to do, you might be able to simulate this behaviour with cookies.

If you're willing to allow a little bit of user intervention, and you're willing to restrict their useage to Internet Explorer, you can use jscript to do exactly what you're looking for, but the user WILL be prompted to allow said action.

Dr.Dredel
A: 

This is not a good idea, there must be a better design for your requirements.

In any case, if you really wanted to do it, and you have full control of the client kiosks, you could install a windows service on them that can manage file uploads/downloads and be controlled via TCP/IP from the web server.

Guy Starbuck
This piques my interest. I have full control of the setup of the machine before it hits the production floors. Can you expand on that TCP/IP and Windows services scenario. Thanks.
A Salim
You could create a windows service that has file system access and upload/download functions, and listens on a TCP port for commands. The kiosk could invoke the web server via HTTP, and it could call back to the IP of the client over TCP/IP and invoke the upload/download action on the service.
Guy Starbuck