dennishall Posted September 16, 2010 Share Posted September 16, 2010 Hi: I'm a newby regarding uploading files to MySQL, turning report output into an HREF, and getting MySQL data via a hyperlink. I have successfully uploaded, files to MySQL, I have also been able to display filename information as a hyperlink in report output, but when I click on the hyperlink, I get the following message format on a 404 page: The requested URL /current_dir_of_requesting_page/filename.filetype was not found on this server. My reporting page has teh following line of code in a report table to create the hyperlink: <td style="width:225px"><? echo "<a href=".$row['name'].">".$row['name']."</a>";?></td> Can anyone assist me with this? Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 What are you storing in that $row['name'] exactly? The first / has previously caused me error. Or even not having quotes in your HTML tag delimiting the URL. Quote Link to comment Share on other sites More sharing options...
dennishall Posted September 16, 2010 Author Share Posted September 16, 2010 Thanks for the info Miss_Reelx: The $row['name'] is storing the filename of teh file stored in the MySQL database. My objective is to have the user click on the href and the file will open using their appropriate viewer. Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 So if I understand correctly... "/current_dir_of_requesting_page/filename.filetype" is the value of the field in your database? Or is it different within your database? OR, is that you giving us the template of all the errors your getting? Have you checked that the path is actually correct? Tried removing that first slash? Tried an absolute path instead of relative? Quote Link to comment Share on other sites More sharing options...
dennishall Posted September 16, 2010 Author Share Posted September 16, 2010 "/current_dir_of_requesting_page/filename.filetype" is the result I see in teh 404 page. The informations stored in the name field in my db is only the filename.filetype. What am trying to return when the href is clicked is the MySQL path and filename.filetype. Example: I upload file.pdf to my db The user sees file.pdf in the name field of teh result page The user clicks the file.pdf link in teh name field and gets the following: ERROR 404 page: /cms/file.pdf not found. btw: /cms/ is teh dir that I'm running the result page in. My question is: How do I define teh path to the file in the MySQL db? Best Regards Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 I didn't even know MySQL could hold pdf files. I got some reading to do! But, a quick google search found this you may be interested in reading: http://www.wellho.net/resources/ex.php4?item=h110/pdfget.php That being said, no idea how to make it into an HTML link off the cuff. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.