Need help in downloading file with header() function
        Posted  
        
            by riccardo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by riccardo
        
        
        
        Published on 2010-05-03T15:17:38Z
        Indexed on 
            2010/05/03
            18:28 UTC
        
        
        Read the original article
        Hit count: 256
        
Hi. I'm trying to explain as best as I can, sorry for my English.
I have a list of links, each linked to a php file with an id by parameters (ex. download.php?id=1 or ?id=2 and so on).
This file create a new instance of a class witch return the correct header of the files so it displays the save dialog box of the browser.
Now I need to check if the files is already downloaded in past (The first time you downloaded it I add a field on the mysql db). This checks go ahead if you haven't download the files, else return false.
Here is the problem, when it returns false or something else the browser redirect me to the download.php file, so I get a blank page or what I'm echoing. I need that if the file is already download it show me a js alert for advice ppl. Hope you can understand what i mean. Thanks for help
© Stack Overflow or respective owner