Answer the question
In order to leave comments, you need to log in
How to implement the display of your files for each user of the site from the same directory?
It is necessary that an authorized user sees his files at http://domain.com/files/myfile.pdf, but the file is actually stored in a folder, for example, /allfiles/user1/myfile.pdf. At the same time, everyone needs that when displaying images in this way, they load quickly, just like from a real directory, and get into the browser cache.
I tried this:
header('Content-type: image/png');
readfile($_SERVER['DOCUMENT_ROOT'].'/allfiles/user1/image.png');
But such an implementation significantly slows down the output of images.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question