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); } ?> 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/ Link to comment https://forums.phpfreaks.com/topic/82874-file-upload/#findComment-421502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.