Posted by Johnny on 10/12/06 23:06
"ljuljacka" <ljuljacka@yahoo.com> wrote in message
news:egljkc$s20$1@news1.carnet.hr...
> first of all tnx for all the help, great people here :)
>
> I tried this code for debuging that you suggested, and on while line I get
> this error: "readdir():supplied argument is not a valid directory resource
> in C:\....\ispit\script.php"
>
> $uploaddir='ispit1/';
> if ($handle = opendir($uploaddir)) { # in php5 use scandir to replace this
> block
> /* This is the correct way to loop over the directory. */
> while (false !== ($file = scandir($handle))) {
> echo "$file<br />";
> }
> } else {
>
> echo "<br />could not open that directory<br />";
> }
>
>
so do you see the file upload now when you use var_dump($_FILES);? as in
have you fixed the first problem?
as for the 2nd:
try this to see if you can see ispit where you think it is
<?php
if ($handle = opendir(getcwd())) {
while (false !== ($file = readdir($handle))) {
echo "$file<br />";
}
} else {
echo "<br />could not open that directory<br />";
}
?>
that should show you if the dir you want is where you want it.
It looks from your code as if the ispit dir is at the same level as your
script but the results of running the other code say it's not.
What does the new code show? is it there? if not then $uploaddir='ispit1/';
won't be valid
if you have your script in say
c:/mysqripts/thescript.php
then your code is now pointing at an upload dir of
c:/myscripts/ispit
I don't think this is a difficult problem...
and please put your reply under here insetad of top posting. |
|
v
Navigation:
[Reply to this message]
|