Current time: 04-23-2014, 09:17 AM Hello There, Guest! (LoginRegister)

Post Reply 
mod_xsendfile "Page not found"
09-20-2011, 07:27 PM
Post: #1
mod_xsendfile "Page not found"
I am using php and xsendfile to serve some large (25-50mb) files.

I have xsendfile enabled and am using the code

PHP Code:
header('X-Sendfile: "'.$fullPath.'"'); 

where $fullPath is the (derp) full path to the file... starting with /home/username/blahblah...

Using php's readfile, this finds the file fine, but is not a viable solution because of the size of the files.

When using xsendfile, the header is sent, but the file is not being found for some reason. I am only getting a webpage not found error.

Any help?
Find all posts by this user
Quote this message in a reply
09-20-2011, 08:14 PM
Post: #2
RE: mod_xsendfile "Page not found"
Remove the double quotation marks on the file name. They aren't part of the filename, so they shouldn't be in the header.
Find all posts by this user
Quote this message in a reply
09-20-2011, 08:26 PM
Post: #3
RE: mod_xsendfile "Page not found"
My god I feel like an idiot. Got it from an example online, so I assumed it was correct.

Thank you so much, that solved it!
Find all posts by this user
Quote this message in a reply
09-20-2011, 10:35 PM
Post: #4
RE: mod_xsendfile "Page not found"
One very depressing thing about programming tutorials online is that, for every correct example, there are probably a few dozen poorly written, outdated, or simply wrong examples. Oh, and you'll probably find all the bad ones first. Sad
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: