Invoke download through javascript

R

RJ

Is their any way by which download dialog can be invoked via
javascript. All i have is url of the file to be downloaded.......
 
E

Evertjan.

RJ wrote on 03 mei 2010 in comp.lang.javascript:
No ..i didn't find the solution there

[Usually there is no "the" solution.]

Then the problem seems to be in your Q.
What do you mean by "invoking" and "dialog" here?
Just "having" an URL is not covering that.

What javascript code have you tried sofar?
 
R

RJ

10.11http://jibbering.com/faq/#fileDownload


well i tried following options :
location.href= url (works in some case but most of the times it opens in a browser)
window.open(url,'Download') (popup blocker issue)..

I guess der isn't any way through javascript....i will have to go for
server side..

Thanks all
 
E

Evertjan.

RJ wrote on 03 mei 2010 in comp.lang.javascript:
I guess der isn't any way through javascript....i will have to go for
server side..

Incorrect.

Javascript is not a pseudonym of clientside.
 
B

Bwig Zomberi

RJ said:
Is their any way by which download dialog can be invoked via
javascript. All i have is url of the file to be downloaded.......

Set location.href with the URL of the download file. If the URL is that
of say a zip file, then the dialog will be displayed. If it is something
that will be displayed inside the browser, then you need to use
server-side code to invoke the dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top