Skip navigation
Currently Being Moderated

linking to a document that hasnt yet been uploaded

May 11, 2012 4:22 AM

i have the uploader working, it sends the document that needs to be uploaded to a file called doc

 

it has the path to the document in a PHPmyadmin Database

 

What do i need to do to link to the document

i have tried the following but obviously it didnt work because it was looking for the userid and not a document

 

<a href="../hostadmin/docs/<?php echo $row_Recordset1['userid']; ?>"><img src="../images/smalldownload.png" width="35" height="35" alt="download" /></a>

 

thanks in advance

 
Replies
  • Currently Being Moderated
    May 11, 2012 7:23 AM   in reply to Jonathan Fortis

    Instead of userid, use the name of the column that stores the filename.

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2012 1:48 AM   in reply to Jonathan Fortis

    Jonathan Fortis wrote:

     

     

    but when i selected the link it just took me to

     

    http://www.webaddress.com/beta/hostadmin/docs/

     

    What is in the 'inventory' column in the database for that entry?

     

    Plus I take it you mean:

    'i have the uploader working, it sends the document that needs to be uploaded to a FOLDER called DOCS'

     

    Rather than:

    'i have the uploader working, it sends the document that needs to be uploaded to a file called doc'

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2012 2:34 AM   in reply to Jonathan Fortis

    Jonathan Fortis wrote:

     

    >>>>>What is in the 'inventory' column in the database for that entry?

     

    the inventory column sotored the path of where the file will be uploaded to

     

     

    Stores the path? It should store the 'name' of the file. You already have the path hard set in the link, no? - ../hostadmin/docs/

     

    This bit just needs to call the name of the file

    <?php echo $row_Recordset1['inventory'];

     

    So when you look at the link it just appends 'filename.jpg' to the path.

     

    ../hostadmin/docs/filename.pdf

     

    If you are storing the path to the file then your link would look like:

     

    <a href="<?php echo $row_Recordset1['inventory']; ?>"

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2012 4:12 AM   in reply to Jonathan Fortis

    Jonathan Fortis wrote:

    but i currently know what they filename ? so i cant add the path

     


     

    If you don't know what the file name is then you can only link to it like you have done (see below) as the filename in the 'inventory' database column has not been populated yet I assume.

     

    <a href="../hostadmin/docs/<?php echo $row_Recordset1['inventory']; ?>"><img src="../images/smalldownload.png" width="35" height="35" alt="download" /></a>

     

    This is why youre getting the link below because I take it at the moment there is no filename associated with the 'inventory' column in your database.

     

    http://www.webaddress.com/beta/hostadmin/docs/

     

    Not sure what you are doing but the idea is to populate the database with the filename at the time the file is uploaded, until then no filename equals blank download link.

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2012 5:02 AM   in reply to Jonathan Fortis

    Jonathan Fortis wrote:

     

    there is a file been uploaded to the inventory column already. so i thought using <a href="../hostadmin/docs/<?php echo $row_Recordset1['inventory']; ?> it would find that file that has been uploaded

     

     

    If a filename exists in the 'inventory' column then your link should return a filename.

     

    If that is not happening then it may be to do with the way you have your mysql query set up.

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 12:03 AM   in reply to Jonathan Fortis

    Jonathan Fortis wrote:

     

    >>>If that is not happening then it may be to do with the way you have your mysql query set up.

     

    how do you mean?

     

     

    What I mean is if you have the below and you have a filename in the inventory database column...

     

     

    <a href="../hostadmin/docs/<?php echo $row_Recordset1['inventory']; ?>

     

     

    ......but the link outputs like below then the mysql query at the top of the page is most likely not set up correctly

     

     

    http://www.webaddress.com/beta/hostadmin/docs/

     

     

    You're using a mysql query on your page to call the information from the database right?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points