Solved

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

Posted on 2006-06-09
1
211 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xml xsd validation free tool to download 10 85
CSS HELP 6 88
MVC and Angular 2 102
AngularJS directive issue 6 70
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 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