Hi ,
I am creating a web page in ASP. I will place some images in the folder,
The images placed in the folder should be disaplayed. I am having the two button in the web page if I click next button then the next image should be dispalyed, If i click prev button then the prev image in the folder shd be displayed.The images are not static... its if today i hav 10 images afetr some time i amy hav 15 images....
Pls help me...
Thanks in advance
7 1976
Displaying the images in the folder
--------------------------------------------------------------------------------
Hi ,
I am creating a web page in ASP. I will place some images in the folder,
The images placed in the folder should be disaplayed. I am having the two button in the web page if I click next button then the next image should be dispalyed, If i click prev button then the prev image in the folder shd be displayed.The images are not static... its if today i hav 10 images afetr some time i amy hav 15 images....
Pls help me...
Thanks in advance
Hi,
To display the images on web page , you can use FileSystemObjec t.
<%
Dim obj
Dim folder
Dim file
'''''Create FileSystemObjec t
Set obj = Server.CreateOb ject("Scripting .FileSystemObje ct")
'''''''Get the folder folder for your image path
Set folder = obj.GetFolder(f olderpath)
'''''''Get each file in that folder
For Each file In folder.Files%>
<img src =<%= file.path%>>
<%Next%>
Displaying the images in the folder
--------------------------------------------------------------------------------
Hi ,
I am creating a web page in ASP. I will place some images in the folder,
The images placed in the folder should be disaplayed. I am having the two button in the web page if I click next button then the next image should be dispalyed, If i click prev button then the prev image in the folder shd be displayed.The images are not static... its if today i hav 10 images afetr some time i amy hav 15 images....
Pls help me...
Thanks in advance
Hi Swetha,
Thanks a lot for ur reply and help....
Its working fine....
It is displaying all the images in the same page......
Thanks a lot
It's a good solution, but he did say he wanted previous/next buttons.
this should work, though, i did not test it. - <%
-
'//----------------------------------------------------
-
'// declare some constants and variables
-
'//----------------------------------------------------
-
dim oFileSystem, oFolder, nFile, i, aFilenames, lookUp
-
-
i = 0
-
const IMAGE_DIRECTORY = "/path_to_my_image_directory/"
-
-
'//----------------------------------------------------
-
'// set up FSO
-
'//----------------------------------------------------
-
set oFileSystem = server.createobject("scripting.filesystemobject")
-
-
'//----------------------------------------------------
-
'// get all images in image directory, store filenames
-
'// in array
-
'//----------------------------------------------------
-
set oFolder = oFileSystem.getFolder(server.mappath(IMAGE_DIRECTORY))
-
-
'//----------------------------------------------------
-
'// resize array to fit number of files in directory
-
'//----------------------------------------------------
-
redim aFilenames(oFolder.files.count - 1)
-
-
'//----------------------------------------------------
-
'// loop through files in folder, assign each to
-
'// index in array
-
'//----------------------------------------------------
-
for each nFile in oFolder.files
-
aFilenames(i) = nFile.name
-
i = i + 1
-
next
-
-
set oFolder = nothing
-
set oFileSystem = nothing
-
-
'//----------------------------------------------------
-
'//determine which image the user wants to look at
-
'//----------------------------------------------------
-
if request.querystring("pic") <> "" and isnumber(request.querystring("pic")) then
-
lookUp = cint(request.querystring("pic"))
-
'//----------------------------------------------------
-
'// make sure the value of lookUp doesn't break
-
'// our array bounds
-
'//----------------------------------------------------
-
if (lookUp < 0 or lookUp > ubound(aFilenames)) then
-
lookUp = 0
-
end if
-
else
-
lookUp = 0
-
end if
-
%>
-
-
<html>
-
<body>
-
<img src="<%= IMAGE_DIRECTORY %><%= aFilenames(lookUp) %>" />
-
<br />
-
<a href="?pic=<%= lookUp - 1 %>"><< Previous</a> <a href="?pic=<%= lookUp + 1 %>">Next >></a>
-
-
</body>
-
</html>
It's a good solution, but he did say he wanted previous/next buttons.
this should work, though, i did not test it. - <%
-
'//----------------------------------------------------
-
'// declare some constants and variables
-
'//----------------------------------------------------
-
dim oFileSystem, oFolder, nFile, i, aFilenames, lookUp
-
-
i = 0
-
const IMAGE_DIRECTORY = "/path_to_my_image_directory/"
-
-
'//----------------------------------------------------
-
'// set up FSO
-
'//----------------------------------------------------
-
set oFileSystem = server.createobject("scripting.filesystemobject")
-
-
'//----------------------------------------------------
-
'// get all images in image directory, store filenames
-
'// in array
-
'//----------------------------------------------------
-
set oFolder = oFileSystem.getFolder(server.mappath(IMAGE_DIRECTORY))
-
-
'//----------------------------------------------------
-
'// resize array to fit number of files in directory
-
'//----------------------------------------------------
-
redim aFilenames(oFolder.files.count - 1)
-
-
'//----------------------------------------------------
-
'// loop through files in folder, assign each to
-
'// index in array
-
'//----------------------------------------------------
-
for each nFile in oFolder.files
-
aFilenames(i) = nFile.name
-
i = i + 1
-
next
-
-
set oFolder = nothing
-
set oFileSystem = nothing
-
-
'//----------------------------------------------------
-
'//determine which image the user wants to look at
-
'//----------------------------------------------------
-
if request.querystring("pic") <> "" and isnumber(request.querystring("pic")) then
-
lookUp = cint(request.querystring("pic"))
-
'//----------------------------------------------------
-
'// make sure the value of lookUp doesn't break
-
'// our array bounds
-
'//----------------------------------------------------
-
if (lookUp < 0 or lookUp > ubound(aFilenames)) then
-
lookUp = 0
-
end if
-
else
-
lookUp = 0
-
end if
-
%>
-
-
<html>
-
<body>
-
<img src="<%= IMAGE_DIRECTORY %><%= aFilenames(lookUp) %>" />
-
<br />
-
<a href="?pic=<%= lookUp - 1 %>"><< Previous</a> <a href="?pic=<%= lookUp + 1 %>">Next >></a>
-
-
</body>
-
</html>
Hi ,
Thanks a lot for ur timely help .. I will check it and let u know...
Thanks again
Hi ,
Its working well. Thanks a lot.
You're welcome :D I am happy it worked out for you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mark Sargent |
last post by:
Hi All,
response.write FilePath gives this path, ImageName.jpeg but the image(s)
doesn't display in the below code. What am I missing..? Cheers.
<%Response.Write FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\") & FilePath%>"><P>
Thumbnail (50% reduction):<BR>
|
by: Michel |
last post by:
Hi,
This is my first post and I may be asking a question that's got a very
simple explanation.
I hope.
I'm building a website and testing it goes fine on Netscape and
Mozilla.
Pixel perfect.
|
by: Vinay |
last post by:
Hi All:
I have a small application that stores images either in the database or as
files (depending on the user preference). I'm in the process of providing a
web interface to this application.
1. If the images are stored in the DB then, every an image is requested, it
will need to be pulled out and a temp file created and then displayed? What
is the best way to do this?
|
by: Jameson |
last post by:
Happy New Year, Everyone!
I am trying to figure out how to display a bunch of images (mainly
JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a
local directory on the system. I can do this with the glob() function,
but I can't seem to put in a directory other than one within the
webroot. For example, I can only put "/uploads" and not
"/Volumes/jray/Pictures...".
Any ideas how to get around this? If I can't use the...
|
by: Lloyd Sheen |
last post by:
I have a list of JPG's which are found in a SQL Server database. When the
page selects a certain piece of data it will refer to the file system
(resident on IIS server with a virtual directory) and files contained within
a certain folder. I have been trying for quite a while to set the ImageURL
of an image control to the correct information.
I have googled till my mind hurts but can find nothing to help. I have even
tried to copy the...
| |
by: kbnolan |
last post by:
I'm somewhat new to this so I know there is something easy I'm missing. I'm editing an existing html page that was built with primarily with css. I have to work with the existing structure and not change it.
The background is in this style
#content-wrapper-1 {
background-color: #d8f5fd;
background-image: url(/images/backgrounds/content-1.png);
background-repeat: repeat-y;
background-position: center 0;
|
by: Marge |
last post by:
After importing a VB6 project into Express 2008 I have two gif's with
transparency do not display correctly.
In VB6 these pictures where used with the image object which had
different properties to the picturebox unfortunately there only seems
to be the picturebox option in the toolbox of Express 2008?
any ideas/help PLEASE :o)
|
by: mvijayrkumar |
last post by:
Hi to all....
Guys pls help me.....
I have an image issue in RLDC while hosting my project on server.The image displays or works fine with the local system.But when hosted on server,both the images(One coming from DataSet and another from my project image folder) not displaying.
Both images are having Type property External and the Values are given correspondingly.ie The One coming from Image Folder;using the Report Parameter ,the...
|
by: Ca1icoJack |
last post by:
I'm new to Javascript and want to write a script which will loop through the files in a folder and display them in a webpage. I've written the following which alternately displays two images in a folder, but I want to be able to add new files to that folder and have them added to this loop. I'm assuming I just need some code to populate the list of files in the folder, but don't know how to do that, nor how to make var have a variable max...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |