Php close window after download file






















This way there are no mysterious popups appearing for the user. Although it may seem fast for you since you are running it locally. On a slow connection, the user would only see a blank popup opening and closing. He might get worried :. If you want users to be able to delete multiple messages at once, you'd have to modify the code so that users can select which messages are to be deleted.

You can use an array of checkboxes for this and modify the delete code to work with an array. But then you'd have to use a FORM element to submit. That's another topic, some info can be found here. The header used there is the PHP header command, It will work. If you need to know where you came from you can pass a variable or look at th PHP referrer.

Javascript won't help you there I'm afraid. Put an hidden iframe somewhere in the page which contains the link to the download page. Note: endpoint: is your new window endpoint setting: is your window setting for example width, height,top, left.. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Auto-closing a popup with a file to download Ask Question.

Asked 7 years, 6 months ago. Active 6 months ago. Viewed 21k times. Here are the codes I tried I placed them after headers : window. What could be the problem? Add a comment. Active Oldest Votes. David Beech David Beech 1, 8 8 silver badges 13 13 bronze badges. Post by bapper » Thu Oct 21, pm Well I invoke download. So far so good. After I've saved I start to get problems with the javascript: On the same page I've got a script switching between two images upon onClick.

Now, after the download part I get "Unspecified error", in IE 6. Code: Select all and. Code: Select all tags where approriate when posting code. Post by feyd » Thu Oct 21, pm trying to output any sort of "text" after a readfile call will be stuck inside that stream. You are sending a download with this script..

The page request calling this code through the client can ask the window to close itself. I would use a javascript function to trigger the page load in a new window the forced download then self. Cheers, Kieran. Post by volka » Fri Dec 15, am intergroove wrote: If I link directly to it my page refreshes to the blank download page.

Post by intergroove » Fri Dec 15, am Kieran Huggins wrote: This is not a php issue - you have to do this in the client. Post by intergroove » Fri Dec 15, am volka wrote: intergroove wrote: If I link directly to it my page refreshes to the blank download page. Post by volka » Fri Dec 15, am intergroove wrote: at this juncture I am already past the deadline on my development, so brevity is the key.

Post by intergroove » Fri Dec 15, am 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.



0コメント

  • 1000 / 1000