Jump to content

Recommended Posts

Hi everybody,

 

          i cant upload the file to server through the php coding even i check with the absolute path and relative file path for uploading. The same coding works well in other servers but not in one particular server give me a suggesstion whether it's a problem in server or anything i need to change in my server configuration.  here i show the coding used for uploading the files

 

<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="userfile"/>
<input type="submit" name="submit" value="submit"/>
</form>
</body>
</html>

 

php file uploading coding(Works well in other servers)

 

<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.

$uploaddir = 'file_upload/here/';

//var/www/html/arvind/SERVER_INFO.php
echo $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_r($_FILES);

print "</pre>";

?>

 

[attachment deleted by admin]

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.