ASM said:
Benjamin a écrit :
You probably can use an artifice,
if access to the folder is allowed you can try to open this folder in an
iframe or a popup, then to analyze links listed in this window via DOM
and to extract paths of images to display them somewhere.
This is counting on the server to list the contents of the directory if
there is no index file. Also, you would have to change your script for
every server.
OK it is not a livable way to do ... but it is possible.
Images on a remote server that you control should be trivial with PHP:
<?php
$localPath = '/usr/home/public_html/images';
$remotePath = '
http://yousite.com/images';
$fileList = '';
echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
echo "var remotePath = \"$remotePath\"";
echo "var imageFilenamesArr = new Array ("
if (is_dir($localPath)) {
if ($dh = opendir($localPath)) {
while (($file = readdir($dh)) !== false) {
$fileList .= "\"$file\",";
}
closedir($dh);
$fileList = substr($fileList, 0, strlen($fileList) - 1); // Remove the
final comma.
}
}
echo ");\n"
echo "</script>";
?>
That's just a draft, but the idea is that you can use PHP to generate your
JavaScript, and basically initialize variables that require some sort of data
from the server side environment. Its a simple, non-AJAXian solution to the
problem. If you're running 5.2.0, you could easily do this with JSON to, but
without the need to do complex XMLHttpRequest calls.
On a server-side file, you _shouldn't_ be able to access it directly with
JavaScript.