syntax101 Posted December 23, 2007 Share Posted December 23, 2007 WHEN I RUN THIS IT CAN UPLOAD A FILE <?php if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) { $uploadDirectory = "d:\\xampp\htdocs\\trip\\"; $uploadFile = $uploadDirectory . basename($_FILES['Filedata']['name']); copy($_FILES['Filedata']['tmp_name'], $uploadFile); } ?> but when i try it to change to localhost it doest work what is wrong with this code <?php if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) { $uploadDirectory = "http://localhost/trip/"; $uploadFile = $uploadDirectory . basename($_FILES['Filedata']['name']); copy($_FILES['Filedata']['tmp_name'], $uploadFile); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/82874-file-upload/ Share on other sites More sharing options...
corillo181 Posted December 23, 2007 Share Posted December 23, 2007 copy doesn't work with full url you have to give it a local url such as /images/ Quote Link to comment https://forums.phpfreaks.com/topic/82874-file-upload/#findComment-421502 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.