How do I not send the browser all the file data during the save prompt?
I'm checking the connection_status() in my shutdown script to detect if the file I'm serving through php was downloaded or interrupted. However since the browser downloads the file during the save pro开发者_如何学JAVAmpt, and it's a very small file (1mb), it's very easy to end up getting false positives where the file has finished downloading in the background, but the user clicks cancel.
Is there a way around this? By say not sending the browser the file until the user explicitly clicks save, or if there is some other mechanism to exploit.
The browser can't know what to save the file as without looking at the headers, and it can't get the headers without getting the file since it may not be safe or effective to do a HEAD
followed by a GET
. So no, there is no way around this.
精彩评论