www.webdeveloper.com
Results 1 to 3 of 3

Thread: Reading local files

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    15

    Reading local files

    Hi,

    There is a slideshow on my website that reads in the address of local images and puts them in a slideshow rotation to be displayed on the page. I currently have to "hard code" the addresses in, similar to the JavaScript below:

    path[0] = "file://///Images/slide_image1.jpg";
    path[1] = "file://///Images/slide_image2.jpg";
    path[2] = "file://///Images/slide_image3.jpg";

    However, I want to be able to place images in the Images directory without having to make sure the files are named the same as in the code. I would like JavaScript to go out to a local directory, see what's in there, grab anything in jpeg format (regardless of the name), and put it in the slideshow rotation. Would anyone have any guidance on how to do this? Thanks!

  2. #2
    Join Date
    Nov 2002
    Location
    London UK
    Posts
    154
    JavaScript doesn't allow access to directories due to security issues, at least not over the internet. You can do this locally or over an intranet, info here:

    http://www.c-point.com/JavaScript/ar...JavaScript.htm

  3. #3
    Join Date
    Sep 2010
    Posts
    15
    Sorry, I should have mentioned that this is an Intranet site.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles