Warning: filesize() [function.filesize]: stat failed for 1.jpg

wht is wrong wth this code

for($index=0; $index < $indexCount; $index++) {
               if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
               print("<tr><td><a href='./pics/$dirArray[$index]'>$dirArray[$index]</a></td>");
               print("<td>");
               print(findexts($dirArray[$index]));
               print("</td>");
               print("<td>");
               print(filesize($dirArray[$index]));
               print("</td>");
               print("</tr>\n");
           }
         }

There is a lot wrong with this code.
Another question is why it is not working as expected. I assume because your pictures are in the pic subdirectory and you are applying the filesize function to a non-existent file in the root directory.
Try

print(filesize("/pic/" . $dirArray[$index]));
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.