Remember to remove the single quotes around the file name. If you use filename='downloaded.pdf', some browsers will try to save the file with the quotes in the filename.
You can use glob to list all PDF files and then you can select the name that you wish and readfile it.
If you would like to echo a link with the UserID in it, then add the rest of filename: <?php echo '<a href="path/'.$_SESSION['user'].'00_01215.pdf">dowload pdf</a>'; ?>. However, if you want to find the PDF file(s) which begin with the user's ID, then do something like this: <?php $directory = opendir...
Bullzip Utility Source - Free software for printing PDF documents and converting Microsoft Access databases to MySQL.
Create a PHP script, name it “download.php” and copy/paste the following code
Finally, once uploaded, all future .PDF links that you want to be downloaded instead of opened in the browser need to point to download.php?file=example.pdf, where example.pdf is the name of the PDF you want for the user to download.
Call the download function with file path,file name and file type output_file($file_path, ''.$_REQUEST['filename'].'', 'text/plain')
The download works but the downloaded file name is index.php.pdf As you note, the site is running in GCI modo on a shared server (no .htaccess, eZ version 4.4). Any suggestions? the client wants the right file name.
This is perfect for files like PDFs, document files, images, and video that you want your customers to download rather than read online.
hi I am new to php. I found a script on this site using a php file to download pdf.