User Name Password Register
DaniWeb IT Discussion Community
All
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
Closed Thread
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Save Target as...

  #11  
Nov 9th, 2005
Update, I searched the web and found out how to do it in javascript:

<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).
 
Join Date: Oct 2005
Posts: 31
Reputation: Bomba is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
Bomba's Avatar
Bomba Bomba is offline Offline
Light Poster

Re: Save Target as...

  #12  
Nov 10th, 2005
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: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Save Target as...

  #13  
Nov 10th, 2005
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"
 
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Save Target as...

  #14  
Nov 10th, 2005
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.
 
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Save Target as...

  #15  
Nov 10th, 2005
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.
 
Join Date: Aug 2005
Posts: 100
Reputation: martinkorner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Re: Save Target as...

  #16  
Nov 26th, 2005
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
 
Join Date: Aug 2005
Posts: 100
Reputation: martinkorner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Re: Save Target as...

  #17  
Nov 29th, 2005
Thanks
 
Join Date: Jan 2006
Posts: 4
Reputation: s1phrx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
s1phrx s1phrx is offline Offline
Newbie Poster

Re: Save Target as...

  #18  
Jan 6th, 2006
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.)
 
Join Date: Aug 2005
Posts: 100
Reputation: martinkorner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Help Re: Save Target as...

  #19  
Jan 10th, 2006
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:
 
Join Date: Jan 2006
Posts: 4
Reputation: s1phrx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
s1phrx s1phrx is offline Offline
Newbie Poster

Re: Save Target as...

  #20  
Jan 10th, 2006
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.
 
Closed Thread

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC