I have now used the same variable, eg. $imageFolder, in the same page, once as an echo statement and once also to read all the files in that directory, eg.
$dir= "$imageFolder"; //<--define the directory to view.
$files = scandir($dir); //<--read all the images into an array.
$im_num = 0; //<--reset image number before count
foreach ($files as $image)
{
if(substr($image, 0, 1) != '.') //<--Ignore anything starting with a period.
{
$image_size = getimagesize("$dir/$image");
//<--Get the image's size in pixels.
$file_size = round( (filesize("$dir/$image")) /1024) . "kb";
//<--Calc size in kb.
$im_num = $im_num - 1;
//<--count every image in the folder.
$rev_im_num = $im_num*-1;
//<--Display the info.
echo "<tr>
<td>$rev_im_num</td>
<td>$image</td>
<td>$file_size</td>
</tr>";
}
}
So now I see the variable as a link so that I know how it looks. I also see if the link works because I get a list of the images in the file with file size. This means that the variable element is the correct file location. Knowing this and knowing that using the link (not the variable) directly in the WA_UploadResult script works, I must conclude that there is nothing wrong with the variable or the folder permissions.
I therefore conclude that WA_UploadResult is taking my variable and ... eating it. Bad boy WA_UploadResult. Only you guys know what your extension is doing and how it is doing it so only you can tell me why your script is turning my variable into air. thanks for listening.