views:

229

answers:

4

I need to download something from server to local machine just by a visiting an url without any popup-window,using something like php or python.But cannot find a good solution.Is it possible or not?Hope someone can help me.

+6  A: 

As the question is stated, I must interpret it as asking for instructions to implement drive-by downloads. See also the previous question http://stackoverflow.com/questions/2226177/how-to-download-files-to-a-default-dir-without-poping-an-option-window-in-flex

Please correct me if I'm wrong.

devio
+7  A: 

No. It would be a violation of the user's privacy to download files to their machine without giving them a clear choice. You can't do this in a regular (default settings) web browser, not even with Java or Flash.

Matthew Flaschen
I have achieved my goal using flex/air.It seems difficult to do that without a client because of the security problem.
SpawnCxy
How come it is not possible with Java or Flash? I am sure that at least with Java you can do this (see http://www.runescape.com).
Petr Peller
As I said, it's not possible with default settings. Runescape uses a signed applet, which allows them to bypass some of the default security settings (even then, only with a prompt). See http://www.runescape.com/slu.ws?j=1
Matthew Flaschen
+2  A: 

Do you want to provide a link on your website and when a user clicks on it you want to start the download of something immediately?

If that is what you want all you have to do is to set the appropriate http header. Let's say you want to provide an xml file for download:

header('Content-type: application/xml');
header('Content-Disposition: attachment; filename="downloaded.xml"');

//now output something:
readfile('the_file.xml'); // or you generate the document dynamically - it doesn't matter

(Please try to be a little more specific in your questions)

Till Backhaus
+1  A: 

I guess you could use an ActiveX control in Internet Explorer, but you still would need security rights to get that done.

Pablo Cabrera