Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Download Dialog

Reply
Thread Tools

Download Dialog

 
 
JCO
Guest
Posts: n/a
 
      10-14-2005
Does anybody have a Download Dialog written in JavaScripts? This is for a
website. I've seen it done before.... where you click on what you want and
the dialog comes up asking you if you want to save it. From what I can
tell, the name of the file is passed as a parameter of the JavaScript.

Below is an example of what somebody (who I don't know) has done:
http://eteamz.active.com/tejanoswhite90girls/handouts/

Thanks


 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      10-15-2005
JCO said the following on 10/14/2005 7:31 PM:
> Does anybody have a Download Dialog written in JavaScripts? This is for a
> website. I've seen it done before.... where you click on what you want and
> the dialog comes up asking you if you want to save it. From what I can
> tell, the name of the file is passed as a parameter of the JavaScript.
>
> Below is an example of what somebody (who I don't know) has done:
> http://eteamz.active.com/tejanoswhite90girls/handouts/


It has nothing to do with Javascript. It has to do with file types,
browser settings, and server-settings. The only thing that *may* be
passed as a "parameter of the Javascript" is the URL to the file but the
download dialog is user-dependent more than anything else and you can
not "force" it.

If the user wants to download it, they can right click>Save target As
(or other wordings).

If the user wants to display it in the browser (and has it set up that
way) then allow them.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
 
Reply With Quote
 
 
 
 
JCO
Guest
Posts: n/a
 
      10-17-2005
Right I understand that. But if it is a pdf, it depends on if they have a
program that reads PDFs. If they don't, it will download otherwise it will
open it. As the case for all file types. I want to force the dialog box
regardless of the file type and regardless of the application they have
installed. The example I showed (link) is downloading a document. I have
"Word" installed, yet the dialog forces me to only download the file.

Other options is have the files zipped.. then they will all download.
Disadvantage is that I have some customers that don't know a thing about
zipping. And I don't want them to download and .exe (extractable) file.

I also want to learn how to do the dialog box for the sake of learning the
JavaScript anyway.

Thanks for your input.


"Randy Webb" <> wrote in message
news:rvWdnXHid5lN083eRVn-...
> JCO said the following on 10/14/2005 7:31 PM:
> > Does anybody have a Download Dialog written in JavaScripts? This is for

a
> > website. I've seen it done before.... where you click on what you want

and
> > the dialog comes up asking you if you want to save it. From what I can
> > tell, the name of the file is passed as a parameter of the JavaScript.
> >
> > Below is an example of what somebody (who I don't know) has done:
> > http://eteamz.active.com/tejanoswhite90girls/handouts/

>
> It has nothing to do with Javascript. It has to do with file types,
> browser settings, and server-settings. The only thing that *may* be
> passed as a "parameter of the Javascript" is the URL to the file but the
> download dialog is user-dependent more than anything else and you can
> not "force" it.
>
> If the user wants to download it, they can right click>Save target As
> (or other wordings).
>
> If the user wants to display it in the browser (and has it set up that
> way) then allow them.
>
> --
> Randy
> comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly



 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      10-17-2005
JCO said the following on 10/16/2005 11:06 PM:
> Right I understand that. But if it is a pdf, it depends on if they have a
> program that reads PDFs. If they don't, it will download otherwise it will
> open it. As the case for all file types. I want to force the dialog box
> regardless of the file type and regardless of the application they have
> installed. The example I showed (link) is downloading a document. I have
> "Word" installed, yet the dialog forces me to only download the file.


That is precisely what I said. It depends on the user's settings. You
have yours set to display Word documents in the browser, I do not.

> Other options is have the files zipped.. then they will all download.
> Disadvantage is that I have some customers that don't know a thing about
> zipping. And I don't want them to download and .exe (extractable) file.


Then educate your users.

> I also want to learn how to do the dialog box for the sake of learning the
> JavaScript anyway.


There is no Javascript that can "force" that download dialog.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-17-2005
Randy Webb wrote on 17 okt 2005 in comp.lang.javascript:
> There is no Javascript that can "force" that download dialog.


In fact there is.

Serverside ASP-javascript can force a stream to be downloaded by:

Response.AddHeader("Content-Disposition","attachment;filename=my.pdf");

[I hope the above displays on one line]

Content-Disposition RFC:
<http://www.faqs.org/rfcs/rfc2183.html>

Clientsided javascript cannot, I agree with Randy.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
JCO
Guest
Posts: n/a
 
      10-17-2005
I hope I can write a JavaScript that is uploaded to the server (as my other
scripts) that can invoke a download dialog (either the standard windows
dialog or a user created dialog).

"Evertjan." <> wrote in message
news:Xns96F285EFE79F0eejj99@194.109.133.242...
> Randy Webb wrote on 17 okt 2005 in comp.lang.javascript:
> > There is no Javascript that can "force" that download dialog.

>
> In fact there is.
>
> Serverside ASP-javascript can force a stream to be downloaded by:
>
> Response.AddHeader("Content-Disposition","attachment;filename=my.pdf");
>
> [I hope the above displays on one line]
>
> Content-Disposition RFC:
> <http://www.faqs.org/rfcs/rfc2183.html>
>
> Clientsided javascript cannot, I agree with Randy.
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-17-2005
JCO wrote on 17 okt 2005 in comp.lang.javascript:
> "Evertjan." <> wrote in message
>> Randy Webb wrote on 17 okt 2005 in comp.lang.javascript:
>> > There is no Javascript that can "force" that download dialog.

>>
>> In fact there is.
>> Serverside ASP-javascript can force a stream to be downloaded by:
>> Response.AddHeader("Content-Disposition","attachment;filename=my.pdf")
>> [I hope the above displays on one line]
>> Content-Disposition RFC:
>> <http://www.faqs.org/rfcs/rfc2183.html>
>>
>> Clientsided javascript cannot, I agree with Randy.


[please do not toppost on usenet]

> I hope I can write a JavaScript that is uploaded to the server (as my
> other scripts) that can invoke a download dialog (either the standard
> windows dialog or a user created dialog).


Sorry, but serverside code [asp-javascript, asp-vbscript, php, etc] kan
only work on the server and usually prepares and renders html content to be
sent to the client, which can have clientside script code, like javascript
[or also vbscript on the IE browser].

The dialog surely must be on the client browser and the download also, be
it that the with serverside code provided header code Content-Disposition
can force the client to use it's own download popup window, instead of the
usual stream that directly dislays pdf.




--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct Download Movies - No Download Limits - Download DivX DVDMovies hussain dandan Python 0 12-06-2009 04:52 AM
How to hide the dialog when execute a dialog based application in VC? yw C++ 3 07-02-2005 03:35 AM
display print preview dialog, not print dialog Matt Javascript 1 11-20-2004 01:18 AM
Download Dialog Box in Internet Explorer ASP .Net 0 07-28-2004 06:37 PM
Download Dialog Defies Description... David Harrison Firefox 0 09-08-2003 01:37 PM



Advertisments