Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Show Images from a Directory!!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedShow Images from a Directory!!!

 Post Reply Post Reply
Author
mzeb View Drop Down
Groupie
Groupie


Joined: 20 December 2002
Location: Pakistan
Status: Offline
Points: 45
Direct Link To This Post Topic: Show Images from a Directory!!!
    Posted: 17 October 2003 at 1:43am

Dear Friends!!!!

Please i need a script which will show images from the directory eg: if i have emoticons in the directory, can u please tell me how can i make a ASP file with which it will display all the images from the directory! so if i upload a image it will be automaticlly there!

best wishes

 

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Direct Link To This Post Posted: 17 October 2003 at 7:12am

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=90

With one little twist

<%
  'Create the FileSystemObject object
  Dim objFSO
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

  'Obtain an folder object instance for a particular directory
  Dim objFolder
  Set objFolder = objFSO.GetFolder("C:\FooBar\Blah\")

  'Use a For Each ... Next loop to display the files
  Dim objFile, FileName, Ext
  For Each objFile in objFolder.Files
     FileName = Mid(objFile.Path,InstrRev(objFile.Path,"\")+1)
     Ext = Right(FileName,4)
     if (Ext=".jpg") or (Ext=".gif") or (Ext=".png") then
          Response.Write FileName & "<br />"
     end if
  Next
%>



Edited by MorningZ
Contribute to the working anarchy we fondly call the Internet
Back to Top
mzeb View Drop Down
Groupie
Groupie


Joined: 20 December 2002
Location: Pakistan
Status: Offline
Points: 45
Direct Link To This Post Posted: 18 October 2003 at 3:48am

Thanks alot!!!!!!!!!!!!!!!!!!!!!

MorningZ Thanks

it working here

Back to Top
mzeb View Drop Down
Groupie
Groupie


Joined: 20 December 2002
Location: Pakistan
Status: Offline
Points: 45
Direct Link To This Post Posted: 18 October 2003 at 4:30am

Dear! MorningZ

its shows just the file names, can u tell me how it will display the images of the directory! !!!!!!!!

please if u do this so i will be very thanksful......



Edited by mzeb
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Direct Link To This Post Posted: 18 October 2003 at 8:50am

c'mon man.. thats as simple as it gets... you have to spend some effort on your own

you'd change:
Response.Write FileName & "<br />"

to:
Response.Write "<img src=""" & FileName & """><br />"

Contribute to the working anarchy we fondly call the Internet
Back to Top
mzeb View Drop Down
Groupie
Groupie


Joined: 20 December 2002
Location: Pakistan
Status: Offline
Points: 45
Direct Link To This Post Posted: 18 October 2003 at 9:15am

Dear MorningZ!!!!

Thanks alot again!!!!!

Can u teach me how to do this one:::

if i have a file let name it 'file.asp' if i have 1 another file 'file2.asp' so,

How should i attach this file to file1.asp, i like this:

file1.asp?page=2 if i enter this so how will it load the file2.asp?????

I m waiting for Reply! 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.