473,412 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

dowload dialog using javascript

hi,
How to dowload a file using javascript.
Dec 28 '06 #1
1 1771
acoder
16,027 Expert Mod 8TB
hi,
How to dowload a file using javascript.
You can't download a file as such using JavaScript. Why would you want to do that anyway? If you must have a page which provides an automatic download, you need to use a server side language, e.g. ASP, ColdFusion, JSP, etc.
e.g. in ASP:
Expand|Select|Wrap|Line Numbers
  1. Response.ContentType = "application/vnd.ms-word"
  2. Response.AddHeader "content-disposition","attachment; filename=" &
  3. StrFileName
or something similar (ASP's not my area of expertise) or in Coldfusion you can use the cfcontent tag. In other words, JavaScript is a client side language - you need to use a server side language for this purpose.
Dec 28 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: JCO | last post by:
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...
3
by: Jerry Camel | last post by:
How do you tell the client how large the file that's being downloaded is? I've seen web sites where the download dialog shows a progress meter. I'm assuming that the server is sending the file...
3
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then...
2
by: Guadala Harry | last post by:
I have a frameset aspx page that enables users to upload photos. One frame/page shows a thumbnail list of prevously-uploaded images, and the other frame/page includes the controls that enable...
4
by: Hitesh | last post by:
Hi, I am opening an Modal dialog box using the window.Showmodaldialogbox(), and in that window i am having an aspx form with say one ASP.NET Button control. i am doing some operation on the...
2
by: comick | last post by:
Hello all, i have a asp.net c# web app 2.0 I have a pdf generation with a third part sw, but i cant download pdf in a new window, from a folder inside my web site. The code i try to use is...
3
by: boney.dalwani | last post by:
Hello All, I m new to JavaScript and widely Exploring programming in js i have a situation where in i do not want to use alert(message); / prompt(message) kind of functionility. rather i want...
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.