I am scripting a download service, as the website is on one server and the download files are on another I am using a pop-up window to launch a php script. The script produces a force-download. All of this works fine - but I'd like to close the window.
intergroove wrote:I am scripting a download service, as the website is on one server and the download files are on another I am using a pop-up window to launch a php script. The script produces a force-download. All of this works fine - but I'd like to close the window.
I could be wrong though. This of course will close the window whether the file downloads ot not since it does not honor the die() in PHP. So even if this works, it may not be the optimal solution.
intergroove wrote:as the website is on one server and the download files are on another I am using a pop-up window to launch a php script. The script produces a force-download.
I don't understand. Why exactly is it you have a pop-up?
intergroove wrote:as the website is on one server and the download files are on another I am using a pop-up window to launch a php script. The script produces a force-download.
I don't understand. Why exactly is it you have a pop-up?
Non-lateral thinking. Designed this early in the project - have just been piecing everything together when I realised the pop-up hangs around (I was just happy toget the force-download to work when I first scripted it). The IFrame solution seems good at the moment though.
Any other suggestions/opinions gratefully received.
intergroove wrote:Send the launch script to an invisible IFRAME. Then I don't have to think about closing the window. Eureka!
Forgive me for beeing dumb but why do you need "another" target window/frame at all? This is no rethorical question; I really do not understand what you're trying to achieve with it. I take it you have some sort of link to download something, simple example
intergroove wrote:Send the launch script to an invisible IFRAME. Then I don't have to think about closing the window. Eureka!
Forgive me for beeing dumb but why do you need "another" target window/frame at all? This is no rethorical question; I really do not understand what you're trying to achieve with it. I take it you have some sort of link to download something, simple example
My download files are stored on a different server below public level. I need to keep the original page in place while force-downloading a file.
The force-download script is on the file server. It needs to be there to get to the files below the root.
If I link directly to it my page refreshes to the blank download page.
Does that make sense? I guess being a lone developer I'm going to make incorrect assumptions in places and use crazy unessessary work arounds. But I try my best.
intergroove wrote:If I link directly to it my page refreshes to the blank download page.
Take a look at http://httpd.apache.org/download.cgi
There's a section "Apache HTTP Server x.y.z is the best available version" and a link e.g. to the unix sources. The link points to a mirror, not an apache.org server. Do you get a new,blank windows when clicking the link?
intergroove wrote:If I link directly to it my page refreshes to the blank download page.
Take a look at http://httpd.apache.org/download.cgi
There's a section "Apache HTTP Server x.y.z is the best available version" and a link e.g. to the unix sources. The link points to a mirror, not an apache.org server. Do you get a new,blank windows when clicking the link?
Much as I appreciate your help - at this juncture I am already past the deadline on my development, so brevity is the key.
If you have a prefered method then please explain it rather than send me on a teachers' style 'journey of discovery'.
I have spent far too long looking for a solution - I've found one that works - it would be nice to know the 'BEST' method but I really haven't got time for a goose chase.
Don't take this the wrong way - as you realise it gets pretty stressful when you go past your scheduled deadlines (+3 wks now).
Having said that Volka you are right. It launched a new window on the first few attempts (early on) so as I pointed out before - I made some assumptions.
If you had been explicit in your reply I might have cottoned on sooner...
@intergroove - In your popup window, since you are forcing the download, why not close the window after the download is forced to begin. Something like as the window is built (the HTML is pushed to the client) just before the closing BODY tag, put a call to a javaScript Function that you make called closeWindow(). Then in this function put the self.close() or window.close() call.
PS | This is a client side problem and is being moved to client side.