kumarrana Posted March 9, 2008 Share Posted March 9, 2008 It is such a stupid questions that I can't fix link problem in my PHP script. Code looks lie this $attached_file = $result_row['attachment']; // Access uploaded file name from database echo "<br><a href=file_upload/$attached_file> Attachment</a>"; //Link to the file, file_upload is folder where file is uploaded Can body find glitch in it? Link to comment https://forums.phpfreaks.com/topic/95187-php-link/ Share on other sites More sharing options...
Baabu Posted March 9, 2008 Share Posted March 9, 2008 <?php $attached_file = $result_row['attachment']; // Access uploaded file name from database ?> <a href="file_upload/<?php echo $attached_file;?> "> Attachment</a> try this !! Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487562 Share on other sites More sharing options...
kumarrana Posted March 9, 2008 Author Share Posted March 9, 2008 Nop, Does not work? Thanks Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487563 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Share Posted March 9, 2008 can you post what is the error u r exactly getting Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487568 Share on other sites More sharing options...
kumarrana Posted March 9, 2008 Author Share Posted March 9, 2008 Not Found The requested URL /blogRedesign/file_upload/ResumeOne.doc was not found on this server. Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487570 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Share Posted March 9, 2008 <a href="/blogRedesign/file_upload/<?php echo $attached_file;?> "> but the url u r using is <a href=file_upload/$attached_file> Attachment</a> what's this Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487572 Share on other sites More sharing options...
kumarrana Posted March 9, 2008 Author Share Posted March 9, 2008 I think I got it. I think there is something to do with file extension when it uploads the file and writes name into database. Let me try that first. I will let you know. Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487575 Share on other sites More sharing options...
Xajel Posted March 9, 2008 Share Posted March 9, 2008 after fixing the path, note the href has an error <a href="file_upload/<?php echo $attached_file;?> "> Attachment</a> this code is correct but there's a space after echoing the variable just remove it and it should work <a href="file_upload/<?php echo $attached_file;?>"> Attachment</a> Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487578 Share on other sites More sharing options...
kumarrana Posted March 9, 2008 Author Share Posted March 9, 2008 I see. Got it. Another problem was it was creating multiple file extension while uploading the file. I fixed both. Thanks bunch for you help. Link to comment https://forums.phpfreaks.com/topic/95187-php-link/#findComment-487579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.