I have a log folder on my ubuntu machine under /var/www/projectlog/logs
which has zip versions of diffrent log files. I want to let users download these zip files from the webpage.
Is this possible to do in PHP ?
I have a log folder on my ubuntu machine under /var/www/projectlog/logs
which has zip versions of diffrent log files. I want to let users download these zip files from the webpage.
Is this possible to do in PHP ?
Try this:
header('Content-disposition: attachment; filename=Resumes.zip');
header('Content-type: application/zip');
readfile("/var/www/projectlog/logs/<NAME_OF_ZIP>");
or just,
readfile("/var/www/projectlog/logs/<NAME_OF_ZIP>"); // as rest will be taken care automatically by browsers
Your PHP File owner should have read access to this path: /var/www/projectlog/logs/