galleeandfarel Posted July 11, 2008 Share Posted July 11, 2008 my design code is <form action="upload.php" method="post" enctype="multipart/form-data"> File: <input type="file" name="filename" /> <input type="submit" value="Upload" /> </form> php code is <?php $folder = "C:\wamp\www\vgotjobs\upload"; if (is_uploaded_file($HTTP_POST_FILES['filename']['tmp_name'])) { if (move_uploaded_file($HTTP_POST_FILES['filename']['tmp_name'],$folder.$HTTP_POST_FILES['filename']['name'])) { Echo "File uploaded"; } else { Echo "File not moved to destination folder. Check permissions"; }; } else { Echo "File is not uploaded."; }; ?> above are my upload php codes, when i run in the localhost,it tells "FILE IS NOT UPLODED" plz give me a hint to upload files in my temp folder...... Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/ Share on other sites More sharing options...
DarkerAngel Posted July 11, 2008 Share Posted July 11, 2008 <?php $folder = "C:/wamp/www/vgotjobs/upload/"; if(is_uploaded_file($_FILES['filename']['tmp_name'])) { if(move_uploaded_file($_FILES['filename']['tmp_name'], $folder.$_FILES['filename']['name'])) { Echo "File uploaded"; } else { Echo "File not moved to destination folder. Check permissions"; } } else { Echo "File is not uploaded."; } ?> Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/#findComment-587366 Share on other sites More sharing options...
galleeandfarel Posted July 11, 2008 Author Share Posted July 11, 2008 thank you so much....it works..... Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/#findComment-587367 Share on other sites More sharing options...
galleeandfarel Posted July 11, 2008 Author Share Posted July 11, 2008 can u please tell me how can i assign some specific file extension???? Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/#findComment-587370 Share on other sites More sharing options...
DarkerAngel Posted July 11, 2008 Share Posted July 11, 2008 can u please tell me how can i assign some specific file extension???? This isn't a vary secure check but add a conditional statement before the move_uploaded_file(); if(substr($_FILES['filename']['name'], -3) == "doc") { ... } Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/#findComment-587385 Share on other sites More sharing options...
galleeandfarel Posted July 11, 2008 Author Share Posted July 11, 2008 that is not working for me dude.... Link to comment https://forums.phpfreaks.com/topic/114227-upload-help/#findComment-587431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.