-
How can I upload a file by php coding
Question asked by visitor Arnab
How can I upload a file by php coding?
I have been try it by xamapp .But the code is running local machine . but when I upload the code on the other server some where the code is not running.
my code as :
***************
if($_REQUEST['Submit']=='Submit')
{
if (($_FILES['fupload']['type'] == "image/gif")|| ($_FILES['fupload']['type'] == "image/jpeg")||($_FILES['fupload']['type'] == "image/pjpeg")){
$archive_dir="thum_imges";
echo $userfile=$_POST['fupload'];
echo "
";
echo $userfiled=$_FILES['fupload']['tmp_name'];
echo "
";
echo $filename=$_FILES['fupload']['name'];
echo "
";
$filenm=basename($filename);
// $up= copy($userfiled,"$archive_dir/$filenm") ;
$up= move_uploaded_file($userfiled,"$archive_dir/$filenm") ;
echo "
up = $up
";
}//End of file check if
}
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules