Page 1 of 1

Need help on File Upload functionality..

Posted: Thu Nov 12, 2009 1:50 pm
by gvlogic
Hi, My name is Gaurav, I am just the beginner in PHP .. i am coding a webpage which will upload a "word/open office" file ..But after several try i am unable to upload ...
I am not clear with different variables needed....Kindly suggest what to do...the lines i have written are below..

<?php
$file_dir="/home/gv/Desktop/upload";
 
echo"path: ".$_FILES["cvt"]."<br> \n";
echo"name: ".$_FILES["cv"]."<br>";
echo"type:".$_FILES["image/jpeg"]."<br>";
echo"size:".$_FILE["10240"]."<br>";
 
if(is_uploaded_file($_FILES["cvt"])){
move_uploaded_file($_FILES["fileupload"]["cvt"],"$_file_dir".$FILES["fileupload"]["cv"])or die ("Coudn't copy");
echo "file was moved";
}
?>


Please suggest what are the errors !!

Re: Need help on File Upload functionality..

Posted: Thu Nov 12, 2009 3:54 pm
by requinix
gvlogic wrote:I am not clear with different variables needed....
Easy enough to address.

Handling file uploads

Re: Need help on File Upload functionality..

Posted: Thu Nov 12, 2009 3:55 pm
by jackpf
PHP will tell you if you turn on error reporting.