Syphon Posted November 21, 2008 Share Posted November 21, 2008 I've got a simple file download script that runs great on my localhost. When I'm testing on our live server it takes forever (1-2 min or so) for the FireFox save dialogue to pop up. When it eventually does and I download the file, the size is 0KB and the file is completely blank! Any ideas on what's causing this? The actual size of the file I'm downloading is less than 5KB. Quote Link to comment https://forums.phpfreaks.com/topic/133679-solved-file-download-issue/ Share on other sites More sharing options...
gevans Posted November 21, 2008 Share Posted November 21, 2008 Post the script your using Quote Link to comment https://forums.phpfreaks.com/topic/133679-solved-file-download-issue/#findComment-695592 Share on other sites More sharing options...
Syphon Posted November 21, 2008 Author Share Posted November 21, 2008 // This script is within a class. The variables values are below // $this->FileLocation = /var/www/html/files/testfile.txt // $this->FileMIME = application/octet-stream // $this->FileName = "My File" // $this->FileSize = 1233 $FileLocation = APPROOT."files/".$this->FileLocation; $FileExt = strrchr($this->FileLocation, "."); header("Content-Type: ".$this->FileMIME); header("Content-Transfer-Encoding: Binary"); header("Content-Length: ".$this->FileSize); header("Content-Disposition: attachment; filename=\"".basename(str_replace(" ", "", $this->FileName).$FileExt)."\""); readfile($FileLocation); exit; Quote Link to comment https://forums.phpfreaks.com/topic/133679-solved-file-download-issue/#findComment-695600 Share on other sites More sharing options...
gevans Posted November 21, 2008 Share Posted November 21, 2008 It all looks fine!! I'm going to have to leave this for someone else to look at, it looks the same as I'd do it Quote Link to comment https://forums.phpfreaks.com/topic/133679-solved-file-download-issue/#findComment-695609 Share on other sites More sharing options...
Syphon Posted November 21, 2008 Author Share Posted November 21, 2008 Hmm, the problem seems to have fixed itself. On our live testing servers I can't seem to download the file; however if the code is executed on the live site (just a different directory on the same server) it works as expected. I wonder if SSL is some how to blame. If it works on my live site then I'm not concerned anymore. It'd be nice to figure out why it doesn't work in a different directory on the same server though. Quote Link to comment https://forums.phpfreaks.com/topic/133679-solved-file-download-issue/#findComment-695644 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.