Well after spending one day looking for this, i found that i was doing it, trying to first download the file and then load another page is too difficult if not impossible. It could be done in the opposite way: first calling the page with the results, statistical info, "Thank you for downloading", etc. and then calling the download: There are two ways of doing it: either with an iframe or by "tricking" the browser into a fake refresh with <meta http-equiv='Refresh'>.
The first one works no problem, it's just an iframe with visibility off. But you get use the whole http protocol options like mime type, file name, etc. which means you have no problem for downloading either text or binary files. The second one NORMALLY only works for "non web-readable" files like exe, zip, etc. because actually what is here is a direct link to download a file. If you put the refresh url as a txt or csv file it will simply do the redirect and display the file on the screen. But if as Gareth says, it was zipped, we could put the link there. But the nice part is that the redirect could also be a symfony action so we have also all the options for a good download (filename, either text or binary files, etc.) Also i should add that by calling an action we can do many thing inside the action like checking against leechers (with the referrer), controlling bandwidth (like megaupload and many sites do). I think it could be also done with ajax. But i don't know if the ajax response would trigger the browser into downloading a file or if we would need, a placeholder for the response, in this case the downloaded file. If somebody knows another way to do it, thanks it would be good to know it. Hope this post may help some people get some answers about it. Julian. On Feb 19, 9:39 am, Julian Montreal <[email protected]> wrote: > Sorry about my double post. I had lost track of my post and thought > that it hadn't been posted. :) > > Yes what you say works but it stays on the same original page all the > time. > > What i want is something like what you get when you download something > at say, download.com or sourceforge.net: It says, "Thanks you, your > download will begin shortly". It has one page for the user at the same > time that downloads the file. I need this because the final page > should say something like "total of records found, statistics, etc, at > the same time that it's downloading the file for the user. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
