recimo ovaj kod:
----------------
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = 'direktorijum upload foldera';
$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>";
?>
izbacuje sledecu gresku:
-----------------------
Warning: Unable to create '/proba/Microphone%2020.gif': No such file or directory in c:\apache\htdocs\proba\index.php on line 9
Warning: Unable to move 'C:\WINDOWS\php16C.tmp' to '/proba/Microphone%2020.gif' in c:\apache\htdocs\proba\index.php on line 9
Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => Microphone%2020.gif
[type] => image/gif
[tmp_name] => C:\WINDOWS\php16C.tmp
[size] => 6664
)
)
zanima me samo, kada radim na localhost-u, da li moram da putanu direktorijuma odredjujem sa kosom crtom na pocetku, recimo "/localhost/direktorijum/" ili mu kosa crta i localhost uopste ne trebaju, recimo "direktorijum", ili pak "/direktorijum/" ili je sve jedno... ?????
malo me buni i 'tmp_name', da li ja treba da odredim putanju do temp direktorijuma na apache-ovom serveru ili to sam kod radi ... ???
Nisam ti pric'o !?