•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,625 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,439 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 17904 | Replies: 25
![]() |
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation:
Rep Power: 32
Solved Threads: 108
Update, I searched the web and found out how to do it in javascript:
Replace
<a href="#" onclick="javascript:document.execCommand('SaveAs','1',null);">Link Here</a>Replace
null with a filename (if you use frames, or if you want clicking the link on one page to save another one). Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
•
•
Originally Posted by tgreer
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.
Sorry but your answer just struck a cord in me because I just had such a bad worm that my antivirus company sent me a custom cleaner which killed all my file associations. I did figure out how to get them back. . well most of them . . but I still need to reformat. The guy who sent the custom cleaner when I called him bawling my head off told me that it was something I got from visiting a website. He looked through my history to try and determine where I got it and how and finally concluded that it was just dumped on me. And they said that they were glad that I had called them with info at hand because others would be calling soon as well. You said that guy couldn't do something that I am not sure that I understand because :
•
•
•
•
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.
But my antivirus guy says that it is why we get viruses and worms and other nasty things on our pc's. So I guess that what I am really asking is what is the real truth here? I don't need help, I want understanding.
Thanks for not laughing too hard at me tgreer.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation:
Rep Power: 32
Solved Threads: 108
The code I provided will pop up with a message box when a link is clicked on. It is similar to those links that say "Click here to add this site to your Favorites / Bookmark list" ... only this one is a "Click here to download this page"
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
cscgal - the code you provided is IE only, and won't work with strict doctypes.
Bomba - spyware works by sneaking in a program that runs concurrently with or as an extension to the browser. It usually works by the user actually installing the spyware, through accepting a page that wants to install a "plug-in" of some sort. Then whenever the browser starts, the spyware starts. That topic really is best explored in the other forum, this one is to discuss client-side programming.
Original Poster - there is no way, as I explained, to code a button that downloads a file, in a completely client-side manner (aside from the IE-only activeX trick).
The proper way to do this is to stream back the proper mime-type. That's server configuration and server-side programming, not client-side. If the user has his browser configured to support that mime-type with a helper application (think "Acrobat Reader" or "Flash"), the stream will be passed to that application. Otherwise, the user will be asked what they want to do with the stream being served. That's the way the web works.
Bomba - spyware works by sneaking in a program that runs concurrently with or as an extension to the browser. It usually works by the user actually installing the spyware, through accepting a page that wants to install a "plug-in" of some sort. Then whenever the browser starts, the spyware starts. That topic really is best explored in the other forum, this one is to discuss client-side programming.
Original Poster - there is no way, as I explained, to code a button that downloads a file, in a completely client-side manner (aside from the IE-only activeX trick).
The proper way to do this is to stream back the proper mime-type. That's server configuration and server-side programming, not client-side. If the user has his browser configured to support that mime-type with a helper application (think "Acrobat Reader" or "Flash"), the stream will be passed to that application. Otherwise, the user will be asked what they want to do with the stream being served. That's the way the web works.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation:
Rep Power: 32
Solved Threads: 108
I'm sorry folks! I misread the question. Ignore me
What I had THOUGHT you wanted was a link that duplicated the Internet Explorer function of selecting "Save As" from the File menu. I completely didn't notice the word "target" for some reason. I shouldn't post too early in the morning anymore.
What I had THOUGHT you wanted was a link that duplicated the Internet Explorer function of selecting "Save As" from the File menu. I completely didn't notice the word "target" for some reason. I shouldn't post too early in the morning anymore. Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
Thanks to everyone who has answered this Thread.
Sorry I haven't replied recently, I changed my e-mail address and didn't update my DaniWeb Account. :lol:
Thanks Again, You've helped a lot!!!
Martin
Sorry I haven't replied recently, I changed my e-mail address and didn't update my DaniWeb Account. :lol:
Thanks Again, You've helped a lot!!!
Martin
•
•
Join Date: Jan 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
You are wanting to allow the user to download a ZIP file from your website? By choice, and by link/button?
Simple, instead of the link pointing to filename.html, use filename.zip. User will get an option to save or run the file.
The same for any file name the browser doesn't recognize.
If it cant render it, it downloads it.
(I didnt read the entire thread on this one, just gave a seemingly-simplified answer.)
Simple, instead of the link pointing to filename.html, use filename.zip. User will get an option to save or run the file.
The same for any file name the browser doesn't recognize.
If it cant render it, it downloads it.
(I didnt read the entire thread on this one, just gave a seemingly-simplified answer.)
When I click on a link, in other websites, to a .zip file it downloads in the background of the webpage with no warning - only a picture of an arrow pointing to a hard disk in the status bar. If the user has a slow connection it can seem like nothing is happening. When it has downloaded, the temporary file where it has saved opens.
I wanted to do the equivalent of right clicking the link and clicking "Save Target As..." - this brings a dialog box saying save or open the file.
:lol: Martin :lol:
I wanted to do the equivalent of right clicking the link and clicking "Save Target As..." - this brings a dialog box saying save or open the file.
:lol: Martin :lol:
•
•
Join Date: Jan 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by martinkorner
When I click on a link, in other websites, to a .zip file it downloads in the background of the webpage with no warning - only a picture of an arrow pointing to a hard disk in the status bar. If the user has a slow connection it can seem like nothing is happening. When it has downloaded, the temporary file where it has saved opens.
I wanted to do the equivalent of right clicking the link and clicking "Save Target As..." - this brings a dialog box saying save or open the file.
:lol: Martin :lol:
I think that may be do to your sys settings.
Maybe "tools|Internet Options|Advanced Tab"
I've used every windows system exceot 2000 and they've always opened a direct download dialog when clicking any file-type that IE cant play itself. So I'm really curious about your situation...I would want to know "for sure" when I'm DLing....lol.....good luck.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- "Save Target As.." isn't working in IE6 (Web Browsers)
- Save target as... (Windows NT / 2000 / XP / 2003)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: form event problem
- Next Thread: Problem in hovering


Linear Mode