Hi all.
This *#&%!9$§# stuff doesnt work and i think im drunk or what for not realizing why...
if i only were drunk, i'd have a reason and some fun then...
it's a testscript straight out of the php manual.
php version: 4.1.2 on apache
rights in ~threehearts/uploads/ : rwx for anyone
box runs debian woody
<body>
<?php
if($sent != 1){
?>
<form name="form1" method="post" enctype="multipart/form-data" action="uploadtest.php">
<input name="aupload" type="file" id="aupload">
<input type="hidden" name="sent" value="1">
<br>
<input type="submit" name="Submit" value="Abschicken">
</form>
<?php
}else{
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
// instead of move_uploaded_file
$uploaddir = '~threehearts/uploads/';
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
<form name="form1" method="post" enctype="multipart/form-data" action="uploadtest.php">
<input name="aupload" type="file" id="aupload">
<input type="hidden" name="sent" value="1">
<br>
<input type="submit" name="Submit" value="Abschicken">
</form>
<?php
}
?>
</body>
if anyone has got an idea, please tell me...
im simply to stupid.
(must be sleeping long enough.. not used to that)
greetings, jakob