arnabphp5 Posted June 8, 2007 Share Posted June 8, 2007 Hi , I am trying to upload file through php code................ if($_REQUEST['Submit']=='Submit') { $filename=$_FILES['file']['name']; $dir='upload'; echo "<br> ".$_FILES['file']['tmp_name'],$dir."/". $filename ; // $uplod=copy($_FILES['file']['tmp_name'],$dir."/". $filename); $uplod=move_uploaded_file($_FILES['file']['tmp_name'],$dir."/". $filename); if($uplod==1) { echo " <br> File upload successfull"; } else { echo " <br> Sorry! File upload unsuccessfull"; } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table width="100%" border="0"> <tr> <td width="29%">Upload Image </td> <td width="71%"><input type="file" name="file" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit" value="Submit" /> </label></td> </tr> </table> </form> </body> </html> But this is not work in all server . please help me .......... need it as early as possible . Quote Link to comment https://forums.phpfreaks.com/topic/54707-please-help-for-file-upload-by-php-coding/ Share on other sites More sharing options...
jaikar Posted June 8, 2007 Share Posted June 8, 2007 are you getting any error messages ?.. if yes, paste it here... make sure you have 777 rights to the directory to which you are uploading the files.... ~J Quote Link to comment https://forums.phpfreaks.com/topic/54707-please-help-for-file-upload-by-php-coding/#findComment-270556 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.