funtime50 Posted March 20, 2007 Share Posted March 20, 2007 Hi, I know this must be really simple but I just cant see why it isnt working. Im uploading a file to a local apache server then inserting the path to a mysql database. I am trying to create a link so it opens the file uploaded, but it gives me this error FireFox doesnt know how to open this address because the protocol © isnt associated with any program Thanks Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/ Share on other sites More sharing options...
genericnumber1 Posted March 20, 2007 Share Posted March 20, 2007 your link must look like "c://blahblahblah" it's probably because you're saving your local file path, not the URL file path into your database. view your source and show us the link you're clicking Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211374 Share on other sites More sharing options...
funtime50 Posted March 20, 2007 Author Share Posted March 20, 2007 Thanks it is like you say it is the links are like this c:\wamp\data\headteacher\bbitsem.adb.assign.rtf How do I change it so it doesnt use the local path Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211381 Share on other sites More sharing options...
genericnumber1 Posted March 20, 2007 Share Posted March 20, 2007 show us the code you're using for the upload script. Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211384 Share on other sites More sharing options...
funtime50 Posted March 20, 2007 Author Share Posted March 20, 2007 <form enctype = "multipart/form-data" action = "s_uploadfile.php" method = "POST"> <b>File location (or select browse):</b><br><br> <input type = 'hidden' name = 'MAX_FILE_SZE' value '300000000'> <input type = 'file' name = 'filename' size = "60"> <p> <input type ='submit' name = 'upload' value= 'upload'></p> </form> inside php tags: $destination = 'c:\wamp\data'."\\".$_FILES['filename']['name']; echo $destination; move_uploaded_file ($_FILES['filename']['tmp_name'], $destination); echo "<br>File Uploaded<br> {$_FILES['filename']['name']} ({$_FILES['filename']['size']})"; Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211396 Share on other sites More sharing options...
funtime50 Posted March 20, 2007 Author Share Posted March 20, 2007 thanks for this and I inserted this into database <input name="path" type="text" id="path2" value="<?php echo $destination ?>"> Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211401 Share on other sites More sharing options...
genericnumber1 Posted March 20, 2007 Share Posted March 20, 2007 if you want the file to be accessible by a browser you'll need to put it into your htdocs directory... (or whatever your base folder is) is "data" your site root? Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211405 Share on other sites More sharing options...
wildteen88 Posted March 20, 2007 Share Posted March 20, 2007 Don't use a system path when displaying the image. Use a HTML path. System path: C:/path/to/something HTML path: http://www.mysite.com/path./to/something (absolute) OR ./path/to/something (relative) It is fine using a system path for uploading the image, but not displaying it. Also firefox uses the file:// protocol in order to access files off of the users file system. Quote Link to comment https://forums.phpfreaks.com/topic/43524-protocol-c/#findComment-211420 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.