Jump to content


File Upload Problem

  • Please log in to reply
1 reply to this topic

#1 Bonzol

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 April 2006 - 05:37 AM

I have the following code


$uploaddir = 'ftp://username:password@';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Possible file upload attack!\n";

echo 'Here is some more debugging info:';

print "</pre>";


The problem is, this appears to work, and the file appears in the ftp server, however the file has no size, its almost as though all that has happend is the file name has been copied and nothing else,,anyone got any suggestions on how to copy the file correctly?

Thanx in advanced

#2 Desdinova

  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 06 April 2006 - 01:27 PM

what does your print_r($_FILES); tell you?
what does your upload form look like?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users