Thank you all for your valuable replies. Iam able to upload the file, store the file in a folder , display an attachment which opens the file stored in the folder which was uploaded earlier.
I learnt 3 things which will be helpful to the viewers. Therefore , I want to list out those key points.
1) It is efficient to pass the filename by using querystring in a href tag through which the filename will be retrieved by the database.
Example : <td><a href="downloadfile.php?file='.$data['Filename'].' ">'.data['Filename'].'</a>
2) It is a good method to use session variables SESSION['sessionvar'] to pass the data through PHP variables from one page to another.
In one php page
<?php
session_start();
$_SESSION['sessionvar'] = $_FILES['FileName']['name'];
In another php page
session_start();
$filename = $_SESSION['sessionvar'];
3) It is always a good practice to store the data (here in this case : filename ) in the database and later retrieve it based on the conditions assumed.
Please let me know for any further information on this post .
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.