Refresh main window after download

This is a discussion on Refresh main window after download within the PHP Language forums, part of the PHP Programming Forums category; Greetings, I have a web application where the main window shows a list of records available for download. The user ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-02-2006
Harold Crump
 
Posts: n/a
Default Refresh main window after download

Greetings,

I have a web application where the main window shows a list of records
available for download.
The user clicks on the download button, which posts the form to another
..php page, which generates the file for download and pops up the
download dialog.

So far, so good.

My question is - how do I refresh the main window once the download
dialog box has popped up?

I need to clear the list of records from the main window (since the
user downloaded it).

The download is generated by another page, and not the main one.

Any ideas?

Thanks,
Harold

Reply With Quote
  #2 (permalink)  
Old 07-03-2006
enerbrat
 
Posts: n/a
Default Re: Refresh main window after download

> My question is - how do I refresh the main window once the download
> dialog box has popped up?
>
> I need to clear the list of records from the main window (since the
> user downloaded it).
>
> The download is generated by another page, and not the main one.
>
> Any ideas?


Not sure about the actual code, but this can be done in Ajax. It sees
that the download has been "touched" by the downloader then it could
redirect or refresh to the needed page.

Once again, I don't know the actual code.. and I'm sure there's a
better way. I just like Ajax better :D

Reply With Quote
  #3 (permalink)  
Old 07-03-2006
Markus Ernst
 
Posts: n/a
Default Re: Refresh main window after download

Harold Crump schrieb:
> Greetings,
>
> I have a web application where the main window shows a list of records
> available for download.
> The user clicks on the download button, which posts the form to another
> .php page, which generates the file for download and pops up the
> download dialog.
>
> So far, so good.
>
> My question is - how do I refresh the main window once the download
> dialog box has popped up?


You could do this at the client side by outputting something like
<script type="text/Javascript">
location.replace('/mainfile.php');
</script>
<a href="/mainfile.php">Go back to List</a>

So Users without Javascript will have to click on the link, but
everybody will safely get back to the list.

HTH
Markus
Reply With Quote
  #4 (permalink)  
Old 07-04-2006
Harold Crump
 
Posts: n/a
Default Re: Refresh main window after download

Hi Markus --

Thanks for the suggestion.

The page that actually launches the download window sets
content-disposition.
Therefore, I don't think I can emit JavaScript through that page -
correct me if I am wrong.

The form in the main window simply posts to that download page, and
therefore doesn't know anything of what's going on.

The form tag on the main screen is as follows -
<form name="frmDownloadOrders" id="frmDownloadOrders" method="post"
action="startDownload.php">

The startDownload.php script generates the download stream and sets
content-disposition.

My issue is refreshing the main screen where the form is after the form
has been posted to startDownload.php

Thanks for any ideas/suggestions.

-Harold.

Markus Ernst wrote:
> You could do this at the client side by outputting something like
> <script type="text/Javascript">
> location.replace('/mainfile.php');
> </script>
> <a href="/mainfile.php">Go back to List</a>
>
> So Users without Javascript will have to click on the link, but
> everybody will safely get back to the list.
>
> HTH
> Markus


Reply With Quote
Reply


Thread Tools
Display Modes

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

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



All times are GMT +1. The time now is 03:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0