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
Jonathan Fortis wrote:
but when i selected the link it just took me to
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'
>>>>>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
Plus I take it you mean:
yes my uploader sends the file (usually docs or pdf's to a folder on the server called DOCS
'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'
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']; ?>"
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.
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
what i am trying to do is
the admin uploads a file with some of the user information on it that they have scanned in and uploaded.
the user can then open / download the file, the only way i though i could then do it is make sure they use a set name to upload then in the href just specify the link
or use a auto rename to the uploaded file?
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.
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?
yes the sql i am using is
mysql_select_db($database_hostprop, $hostprop);
$query_Recordset1 = sprintf("SELECT * FROM plus_signup, host_editprop WHERE host_editprop.prop_id=plus_signup.prop_id AND userid = %s", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysql_query($query_Recordset1, $hostprop) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
the inventory are in the plus_signup table
North America
Europe, Middle East and Africa
Asia Pacific