Hi there,
I would appreciate some advice here with regard to the following. (I have done extensive searching in the forum and manual but haven't gained much)
I am setting up a database which has a username and password for people accessing work files. I've already got the logging in working with cookies so far. They will each have files in a folder /files/storage/$username/ on the server, which is protected from the web (because I want to send them the file through a script instead).
Is there a way I can read in /files/storage/$username/$filename to a variable, and then output it? If I try and access a file in an unprotected folder it works fine, but when I try to access it from /storage/* (since it is protected) I cannot access it.
Possibly, is there a function I can use in PHP (version 3.0.12) that I can send the unix user and password similar to the following function
<snip> $content = fread($filedata, filesize($filename)); </snip>?
It would be marvelous if I could just do something like <snip> $content = fread($filedata, filesize($filename), $mainwebusername, $mainwebpassword); </snip>
I had looked at using FTP even to get the file, but that requires PHP 3.0.13 or greater. Unfortunately my box is on a really strict no upgrade policy, and if I upgrade and do something wrong I might be in debt till I die :-)
Note, I had thought of using a database instead for this, but the files will be around 20MB in size, and it doesn't seem good to upload with HTTP files of such size, however I would like the clients to download using HTTP because they are lamers in most cases and not familiar with FTP.
Thanks in advance for any insight.
Stan.