Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Showing Content Of A Directory In An IFRAME

Asked Modified Viewed 1,506 times
T
Trix
T
Trix 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
asked
Junior Member

G'day all,

Just needing some help. I have alot of files I want my members to access and I figure that using an IFRAME on a content page would be my best bet. Simply upload the files and they can click on them and download them. But I don't seem to be able to get it to work. Can anyone help me. I would really appreciate it.

Thanks In Advance
Cheers
0 replies

4 posts

H
HaCk3R
H
HaCk3R 10
Data technician and developer spawned form the PHP-Fusion community :-)
  • Senior Member, joined since
  • Contributed 223 posts on the community forums.
  • Started 17 threads in the forums
answered
Senior Member

well you could make a page that auto makes a file list of the folder?
0 replies
T
Trix
T
Trix 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
answered
Junior Member

G'day HaCk3R,

Well can you show me, thats why I'm asking. I need some help with this please.

Thanks
0 replies
H
HaCk3R
H
HaCk3R 10
Data technician and developer spawned form the PHP-Fusion community :-)
  • Senior Member, joined since
  • Contributed 223 posts on the community forums.
  • Started 17 threads in the forums
answered
Senior Member

I haven't tried this before.. but this is the function found in maincore.php
// Create a list of files or folders and store them in an array
function makefilelist($folder, $filter, $sort=true, $type="files") {
   $res = array();
   $filter = explode("|", $filter);
   $temp = opendir($folder);
   while ($file = readdir($temp)) {
      if ($type == "files" && !in_array($file, $filter)) {
         if (!is_dir($folder.$file)) $res[] = $file;
      } elseif ($type == "folders" && !in_array($file, $filter)) {
         if (is_dir($folder.$file)) $res[] = $file;
      }
   }
   closedir($temp);
   if ($sort) sort($res);
   return $res;
}


so you could do something like this


<?php
makefilelist ("downloads/");
$files = $res;


and then echo the $files in a while loop or like

haven't tried this my self so it is only a guess

i hope it helps ;)
0 replies
C
cjsewell
C
  • Member, joined since
  • Contributed 65 posts on the community forums.
  • Started 3 threads in the forums
answered
Member

My FS Downloads infusion may work nicely for you.
You can find it here

It is in beta, but should be pretty stable.

Cheers

CJ
Edited by cjsewell on 29-04-2006 16:36,
0 replies

Category Forum

General Discussion

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

H
H
HaCk3R 10
Data technician and developer spawned form the PHP-Fusion community :-)
  • Senior Member, joined since
  • Contributed 223 posts on the community forums.
  • Started 17 threads in the forums
T
T
Trix 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
C
C
  • Member, joined since
  • Contributed 65 posts on the community forums.
  • Started 3 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet