PDA

View Full Version : Regarding problem related with opening save dialog


sumitghosh
03-26-2003, 12:57 PM
i am having the download exe links of some softwares in the my database. Now when any user wants to download the software i want the save dialog box to apper on the screen.for that i am using window.open and passing the exe link as the url.

the problem is when the user clicks for download then atfirst a blank window appears on the screen, which after few seconds gets converted into the save dialog.i don't want to show users the blank window for that small time.i want the dialog to appear directly.

please tell me how i can do that.
thanks

Roelf
03-26-2003, 02:32 PM
link directly to the exe:
<a href="thefile.exe">click here to download</a>

sumitghosh
03-27-2003, 07:00 AM
thanks.

BUt the solution you gave is by using a href.
but what happens is that i have an download image and after clicking on the image two thinks should happen simultaneously.
1. the Save Dialog box should appear
2. the page behind should change to the downloading page.

for this purpose i cant use ahref.
please let me know if u have any other solutions.

glenngv
03-27-2003, 07:20 AM
link to the downloading page like this:

<a href="download.htm">click here to download</a>

then put this in the download page:

<body onload="location.href='thefile.exe'">
The exe file will be downloaded in a moment...<br>
If the Download dialog does not display, click <a href="thefile.exe">this</a>.

<!--other content here-->

</body>

sumitghosh
03-28-2003, 04:48 AM
Thnks again.
i tried out the above method and its working fine initially.but what happens is i have got a search text box on my page.now if someone clicks the on the search button without entering any text to search the download page gets loaded again and on the body onload event the download.exe is called again and the save dialog box pops up.
please suggest me any suggestion for this.

glenngv
03-28-2003, 07:23 AM
do you call the download page from 2 instances? in searching and in clicking the download link? can you explain more in detail the navigation of your pages?

sumitghosh
03-28-2003, 08:55 AM
Thanks glenn.
see i am not calling the download exe twice. i will explain in details whats happening exactly.

see clicking on a link on my home page , i am redirected to the download page.As the download page is shown at the back then the save dialog box for the exe should appear on the screen.

On the download page's body onload if i am doing as suggested by u, then its working fine.

But then it gives me another problem.On my download page a have a search text box and a button.when an user enters some text fro serching he is taken to the search page.
but if the user has not entered anything on the search page then i dont take him to the search page but kepp him still on the download page.

Here lies the problem with body onload.without entering any thing if the user is clicking on the serch buttong the page gets refreshed and so the exe is called again. i dont want this to happen.i want the exe to be called only once, ie during my first visit to the page.Thats why by using a flag i was trying to use window.open(),but it didnt work as i wished.

please see if u can provide me a solution.
Thanks

glenngv
03-28-2003, 09:13 AM
when you take the user to the download page after the user does a search without specifying the text to search, add a querystring in the url like:

download.htm?action=1

then just read the querystring and call the exe file only if the correct value is set. if you are you using a server-side language, it should be easy to read the querystring. if it's pure html, you can use this script (http://codingforums.com/showthread.php?s=&threadid=11802).