I have a fil.php to upload files to my server. There's no error-message but the files do not apper where they should, the don't aper at all...
$target = 'galleri/';
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
//Filstorlek, försök gör bildstorlek
if ($_FILES['uploaded']['size'] > 100000)
{
echo "<p>Filen är för stor.</p>";
$ok=0;
}
//Inga phpfiler
if ($_FILES['uploaded']['type'] == "application/x-php")
{
echo "<p>Inga phpfiler tack!</p>";
$ok=0;
}
//Om ok är noll, avbryt
if ($ok==0)
{
echo "<p>Filen laddades inte upp</p>";
}
//Flytta filen om allt ok.
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "<p>Filen ". basename( $_FILES['uploaded']['name']) . " laddades upp till $target.</p>";
}
else
{
echo "<p>Något blev fel vid uppladdningen.</p>";
}
}
echo "<pre>";
print_r($_FILES);
echo "</pre>";
echo $target;
print_r($_FILES); gives:
Array
(
[uploaded] => Array
(
[name] => logo.gif
[type] => image/gif
[tmp_name] => /tmp/phpbgPgMu
[error] => 0
[size] => 8244
)
)