Page 1 of 1

File uploading is not working

Posted: Sat Feb 28, 2009 5:25 am
by asmitacp
Hiiii,
I am using file uploading in my program but it is not working...
Following is the code..............

<?php

$tmp_name = $_FILES["text_file"]["tmp_name"];
$name = $_FILES["text_file"]["name"];
if(move_uploaded_file($tmp_name, "$uploads_dir/$name"))
echo"file moved proerly!!!";
else
echo"error in file uploading!!!!!!";


?>



Can anybody help me ?????

Re: File uploading is not working

Posted: Sat Feb 28, 2009 5:36 am
by susrisha

Code: Select all

 
$tmp_name = $_FILES["text_file"]["tmp_name"];
$name = basename($_FILES["text_file"]["name"]);
$upload_path = $uploads_dir.'/'.$name;
if(move_uploaded_file($tmp_name, $upload_path))
echo"file moved proerly!!!";
else
echo"error in file uploading!!!!!!";    
 
Try to replace the code with this..

Re: File uploading is not working

Posted: Sat Feb 28, 2009 5:47 am
by asmitacp
It shows error message

error in file uploading!!!!!!

Re: File uploading is not working

Posted: Sat Feb 28, 2009 6:04 am
by asmitacp
Its working ...
problem was in folder permission.......