3 Replies - 345 Views - Last Post: 25 December 2012 - 08:56 AM Rate Topic: -----

#1 colerelm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 26-April 12

Filling a webpage with file names

Posted 24 December 2012 - 04:01 PM

Where would I start if I wanted to learn how to read file names from somewhere(my computer, for example), and write those names onto my webpage? I want to be able to iterate through one of my folders on my computer and print a list of the names of the files onto a webpage.

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Filling a webpage with file names

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8948
  • View blog
  • Posts: 33,544
  • Joined: 12-June 08

Re: Filling a webpage with file names

Posted 24 December 2012 - 04:15 PM

Typically you would need something on your machine... And php wouldn't be the best option. I would think an app that is on the machine that gathers up the info and writes to a web service and that service stores the info in a db table.

Though php does have directory iterator function.

http://php.net/manua...getfilename.php
Was This Post Helpful? 0
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: Filling a webpage with file names

Posted 25 December 2012 - 08:43 AM

For obvious security reasons, no browser will give your website access to the local file system. Neither would things like Flash or Java applets let you scan the local file system, for the same reason.

So, yea, like modi123_1 says, you'd have to run a program on your machine, which has access to your files, and use that to upload the results to your website.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5189
  • View blog
  • Posts: 26,896
  • Joined: 10-May 07

Re: Filling a webpage with file names

Posted 25 December 2012 - 08:56 AM

I would use php to receive a file list from a program, but not the other way around. php can't launch on it's own without some sort of a scheduler.

I would write a program to create a csv or xml file, & then push it to a url, & then have php parse that file into a db. Then the webpage can create the file list from that db.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1