Need help on File Upload functionality..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gvlogic
Forum Newbie
Posts: 1
Joined: Thu Nov 12, 2009 1:41 pm

Need help on File Upload functionality..

Post 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 !!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help on File Upload functionality..

Post by requinix »

gvlogic wrote:I am not clear with different variables needed....
Easy enough to address.

Handling file uploads
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Need help on File Upload functionality..

Post by jackpf »

PHP will tell you if you turn on error reporting.
Post Reply