Solved

Ajax - Can u get access to Files on Server via Ajax?

Posted on 2006-06-09
1
213 Views
Last Modified: 2010-04-06
I am trying to read images that are being stored and deleted periodically on one of the directories on my server. What I want to do is create a slideshow of these images. This would be easy using javascript, but since  I don't  know how many images to work with, and since the images are on my server, that makes it a bit harder. I tried doing this via server side code already, but encountered a few problems.. See below link. Anyway, I know javascript can't access my server file, but can Ajax? If so.. can you provide a source or example where I can get started?

Thanks in advance.

my server side code attempt.. close.. but not quite there...

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21880206.html
0
Comment
Question by:LeeHenry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
nschafer earned 500 total points
ID: 16872844
Hi LeeHenry,

Yes, AJAX can do this.  AJAX in a simplistic description allows communication between server-side and client-side scripts.  I don't use ASP.NET, so I can't explain how to do it using ASP.Net, but using classic ASP you would have two pages.  An HTML page that would display the images.  There would be a javascript function making an AJAX call to determine the next image to show.  The AJAX function would get the results of an ASP page that would use the File System Object (FSO) to read the directory of the folder where your images are stored and send the url path to the file back to the javascript function.  

The javascript function would probably have to send back to the ASP page an index number of the image it is currently displaying so that the ASP page would know which image needed to be displayed next.

Hope this helps,
Neal.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question