Jump to content

Sandeep590

Members
  • Posts

    22
  • Joined

  • Last visited

Community Answers

  1. Sandeep590's post in To Create an hyperlink in PHP which is used to open an file with any format which is saved on the server folder was marked as the answer   
    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 . 
×
×
  • Create New...

Important Information

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.