Page 1 of 1
get files of a folder on the web
Posted: Sun Nov 27, 2011 5:27 pm
by jmburnod
Hi All,
I thought
Code: Select all
on mouseUp
set the defaultfolder to "http://www.alternatic.ch/jmb/DesImages/"
put the files
end mouseUp
work, but it return the files of the old defaultfolder
What i forget ?
Best regards
Jean-Marc
Re: get files of a folder on the web
Posted: Sun Nov 27, 2011 5:49 pm
by Klaus
Hi Jean-Marc.
setting the defaultfolder to any folder on the internet does not work as on the desktop!
But I have no idea what you could do instead
Some servers will return a file listing, probably in HTML format!, if you just get the FOLDER address and there is NO "index.html" in that folder,
but this is mostly forbidden for security reasons:
...
put url "
http://www.alternatic.ch/jmb/DesImages/"
...
Gives: error 403 Forbidden
Best
Klaus
Re: get files of a folder on the web
Posted: Sun Nov 27, 2011 11:03 pm
by jmburnod
Hi Klaus,
Thank for quick reply
setting the defaultfolder to any folder on the internet does not work as on the desktop!
It work on IOS ?
Some servers will return a file listing, probably in HTML format!, if you just get the FOLDER address and there is NO "index.html" in that folder,
but this is mostly forbidden for security reasons:
Ok i can upload a text file with the list of files and reading it.
Best
Jean-Marc
Re: get files of a folder on the web
Posted: Mon Nov 28, 2011 10:59 am
by Klaus
Bonjour Jean-Marc,
jmburnod wrote:setting the defaultfolder to any folder on the internet does not work as on the desktop!
It work on IOS ?
No, I mean the internet in contrary to LOCAL files/folders
jmburnod wrote:Some servers will return a file listing, probably in HTML format!, if you just get the FOLDER address and there is NO "index.html" in that folder,
but this is mostly forbidden for security reasons:
Ok i can upload a text file with the list of files and reading it.
Ah, yes, if that is possible, that will be the best way!
Best
Klaus
P.S.
I found a PHP snippet on my HD taht will return a file listing of the folder where the PHP script resides!
Just copy this into a new textfile, save it as: filelisting.php
in the folder on your server and you will always have an up-to-date file listing with:
...
put url"
http://www.yourserver.com/folder1/filelisting.php" into field "Files on server"
...
Code: Select all
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
}
?>
Re: get files of a folder on the web
Posted: Tue Nov 29, 2011 12:10 am
by jmburnod
Hi Klaus,
Great
I will test it wenesday
Thank one more
Best
Jean-Marc
Re: get files of a folder on the web
Posted: Wed Nov 30, 2011 6:42 pm
by jmburnod
Hi Klaus
I tested the php way but it return empty
i put a little stack in attachment
Best
Jean-Marc
Re: get files of a folder on the web
Posted: Wed Nov 30, 2011 7:03 pm
by mwieder
That seems like the correct behavior. If I test the url in your stack it returns empty. Put "
http://www.alternatic.ch/jmb/DesImages/filelisting.php" into a browser and there's nothing returned. I don't get a "not found" error, so the php code is executing on the server.
OTOH I get file permissions trying to access the web site folder at either jmb or DesImages, so there may be some permissions problems as well. I think you need to make sure the php code on the server is working before trying to troubleshoot the LC script.
Re: get files of a folder on the web
Posted: Wed Nov 30, 2011 7:24 pm
by Klaus
Hi Jean-Marc,
I tested your stack and got "error 500 Internal Server Error" in THE RESULT.
I have tested the PHP script before and know that it is working (although I have no idea why

)
So there must be something going on on your server, maybe there is no PHP engine installed?
Although I doubt this!
Best
Klaus
Re: get files of a folder on the web
Posted: Wed Nov 30, 2011 7:59 pm
by sturgis
A slightly OT question re: php and file listings.
Since I don't understand enough php to know whats going on with this code..
Code: Select all
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
}
?>
I tried this instead.
Are there reasons to avoid shell_exec? Security or otherwise? Maybe shell_exec isn't always allowed I guess, so maybe thats why. Just a curiosity question, both work fine for me on on-rev.
Re: get files of a folder on the web
Posted: Thu Dec 01, 2011 10:08 am
by jmburnod
Hi,
Thank for reply
So there must be something going on on your server, maybe there is no PHP engine installed?
Although I doubt this!
I have sent a message to the administrator of alternatic.ch
Best regards
Jean-Marc
Re: get files of a folder on the web
Posted: Tue Dec 20, 2011 11:08 pm
by jmburnod
Hi Sturgis,
Thank for reply
I send your script to the alternatic administrator
Klaus:
We tested your script with an other serber and it work well
Best regards
Jean-Marc
Re: get files of a folder on the web
Posted: Wed Dec 21, 2011 12:48 pm
by jmburnod
Hi,
Someone send me a php script of Greg Johnson and it work with the site
alternatic.ch (there is a spip on a Linux server)
I put an example stack in attachment
I do not still know why the script of Klaus does not work (with this server only)
Best regards
Jean-Marc