Jump to content


This topic is now archived and is closed to further replies.


File Upload Problem

Recommended Posts

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

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.