DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Save Target as... (http://www.daniweb.com/forums/thread31140.html)

martinkorner Aug 25th, 2005 10:40 am
Save Target as...
 
How do I make a button that will bring up the download box for something on my website, without the user having to right-click and select "Save Target as..." :?:
Thanks
:lol: Martin :lol:

tgreer Aug 25th, 2005 11:54 am
Re: Save Target as...
 
You can't. This is fundamental "user interface" 101. A programmer shouldn't attempt to force actions that are historically under user control. Also, what you're attempting violates the browser security model. Just imagine the havoc that would be caused if a web page could "silently download" anything as soon as you browse to it.

I understand you simply want the dialog to pop up, but it's still not allowed.

martinkorner Aug 26th, 2005 6:35 am
Re: Save Target as...
 
Oh well...
Thanks anyway
:cool:

akadez Sep 27th, 2005 8:18 pm
Re: Save Target as...
 
The future is web applications, and needs to provide the same capabilities as a WinForms, if the developer deems so. 90% of my sites are intranet based, so I do not have the fear of anonymous users. If you are using the .NET framework you have some options. You have the ability to create a server-side method or page dedicated to writing the document to the response stream. This will cause the parent page to postback, but it will prompt for download. If you are looking to do this without postback you this can achieved using AjaxPro, http://ajaxpro.schwarz-interactive.de, or other any other Ajax frameworks.

martinkorner Oct 1st, 2005 5:19 pm
Re: Save Target as...
 
What ??? - sorry I'm not with that at all can you explain again please?

Martin

P.S. I wanted to make a link on my website so that when someone clicked on it a .zip file would download - to save them right clicking and clicking on "Save Target as..." etc.

tgreer Oct 1st, 2005 5:33 pm
Re: Save Target as...
 
It can't be done with HTML, CSS or JavaScript, the topics covered in this forum. What akadez is referring to are some possible techniques in ASP.NET, a server-side language. Daniweb has an ASP.NET forum, if you code in that language.

felgall Nov 6th, 2005 2:38 pm
Re: Save Target as...
 
Most of your visitors will have .zip files set to offer as download rather than process automatically so you could upload in that format. There is also code that can be put in the .htaccess file to force what you want if your site is running on an apache server.

Bomba Nov 9th, 2005 9:38 pm
Re: Save Target as...
 
Quote:

Originally Posted by tgreer
You can't. This is fundamental "user interface" 101. A programmer shouldn't attempt to force actions that are historically under user control. Also, what you're attempting violates the browser security model. Just imagine the havoc that would be caused if a web page could "silently download" anything as soon as you browse to it.

I understand you simply want the dialog to pop up, but it's still not allowed.


Excuse me but the idiot has arrived :o with a question :?: about your answer. Pages seem to download a lot of crap onto my machine when I browse the internet. I have gotten worms, spyware, and other malicious stuff without ever asking for it nor agreeing to it. *thinks I need to hide under the bed now as you are all probably dying laughing* but I really want to know. When you stop laughing at me will you please explain this to me? :rolleyes:

tgreer Nov 9th, 2005 10:57 pm
Re: Save Target as...
 
I don't mind the question, but you're asking it in the wrong spot! Daniweb has a forum specifically for these types of issues: http://www.daniweb.com/techtalkforums/forum64.html

If you'll peruse that forum, I think you'll get the education you seek! If not, feel free to post a new thread there. No one will bite your head off; we try to be a friendly group.

cscgal Nov 9th, 2005 11:31 pm
Re: Save Target as...
 
Wait wait wait ... what is being asked is a client-side technology, not server-side at all ... Anything that would interact directly with the web browser - such as opening a dialog menu, would have to be a client-side script.

Server side scripts can interact with files on the server, but you need something client side to interact with files or applications (in this case, the web browser) on the client side of things.

I think this could be accomplished in DHTML (although I'm not sure specifically how to go about it), can it not?


All times are GMT -4. The time now is 5:24 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC