ERLEDIGT
NEIN
NEIN
ANTWORTEN
6
6
ZUGRIFFE
4581
4581
EMPFEHLEN
-
27.02.02 11:29 #1
ich habe ein uploadfeld für meine seite erstellt. nun kann jeder seine eigenen bilder uploaden und sie werden automatisch in den ordner kopiert.
nun stellt sich mir eine frage: wie kann ich meinen ordner per asp nach .gif und .jpg dateien durchsuchen und alle diese bilder auf meiner seite darstellen lassen?----------------------------------
by black-dog
If you hold back anything, I'll kill ya.
If you bend the truth or I think your bending the truth, I'll kill ya.
If you forget anything I'll kill ya.
In fact, you're gonna have to work very hard to stay alive.
Now, do you understand everything I've said? Because if you don't, I'll kill ya.
-
27.02.02 11:39 #2Quentin Tutorials.de Gastzugang
super-quentin eilt zur rettung
ehm ja hust...
hab eh nix besseres zu tun, also bitteschön:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<% Set fso = Server.CreateObject("Scripting.FileSystemObject") Set objFldr = fso.GetFolder(server.mappath("/bilder")) Set objFileColl = objFldr.Files For Each file in objFileColl if instr(lcase(file.Name),".gif") <> 0 OR instr(lcase(file.Name(,".jpg") <> 0 OR instr(lcase(file.Name),".jpeg") <> 0 then Response.Write "<a href='"&file.Name&"'>" & file.Name & "</a><br>" end if Next Set objFldr = Nothing Set objFileColl = Nothing Set fso = nothing %>
habs nicht getestet
müsste funktionieren...
hope that helps
gruß
q
-
27.02.02 11:58 #3
ein paar verwirrungen mit den klammern waren drin aber jetzt sollte es laufen.
allerdings habe ich nen ordner namens bilder erstellt und einige dateien da reinplaziert, nun kommt: "Der Pfad wurde nicht gefunden".
der fehler soll in der zeile: "". ich habe meinen ordner bilder genannt und er befindet sich im selber verzeichnis wie die asp datei******Code :1
Set objFldr = fso.GetFolder(server.mappath("/bilder"))
wo könnte der fehler liegen?----------------------------------
by black-dog
If you hold back anything, I'll kill ya.
If you bend the truth or I think your bending the truth, I'll kill ya.
If you forget anything I'll kill ya.
In fact, you're gonna have to work very hard to stay alive.
Now, do you understand everything I've said? Because if you don't, I'll kill ya.
-
27.02.02 12:05 #4Quentin Tutorials.de Gastzugang
/bilder = ordner vom root deiner page / des webs ausgehend, also zb http://www.domain.com/bilder
du kannst auch ../bilder oder so angeben, auf jeden fall einen relativen pfad..
du kannst auch statt server.mappath("/bilder") folgendes verwenden (wenn du die struktur am server kennst: fso.GetFolder("D:\INETPUB\WWWROOT\PAGE\BILDER\")
ka
sag mal die genaue url oder so wo die bilder erreichbar sind
-
27.02.02 12:45 #5
auch das ****t nun, aber schon wieder gibts n neues fehlerlein:
Code :1
if instr(lcase(file.Name,".gif")) <> 0 OR instr(lcase(file.Name,".jpg")) <> 0 OR instr(lcase(file.Name,".jpeg")) <> 0 then
irgendwas mit lcase stimmt nicht (Falsche Anzahl an Argumenten oder ungültige Eigenschaftszuweisung: 'lcase' ).
bei dieser gelegenheit:
was bewirken lcase und instr?
bin ich richtig in der annahme dass ich fso, objFldr, objFileColl umbenennen kann, dass ichs überall ändern muss ist mir klar
******
----------------------------------
by black-dog
If you hold back anything, I'll kill ya.
If you bend the truth or I think your bending the truth, I'll kill ya.
If you forget anything I'll kill ya.
In fact, you're gonna have to work very hard to stay alive.
Now, do you understand everything I've said? Because if you don't, I'll kill ya.
-
27.02.02 13:17 #6Quentin Tutorials.de Gastzugang
if instr(lcase(file.Name),".gif") <> 0 OR instr(lcase(file.Name),".jpg") <> 0 OR instr(lcase(file.Name),".jpeg") <> 0 then
so sollts richtig sein, sorry war ne quick lösung weil ich ja bei der arbeit bin
LCASE = lower case, verwandelt den string so um das alle großbuchstaben zu kleinbuchstaben werden, hab ich gemacht damit ich nicht auch noch GiF oder Jpeg oder JPEG usw abfragen muss
INSTR = in string - überprüft ob der angebene string (also hier ".gif", ".jpg", ".jpeg" im ersten string lcase(file.Name) enthalten ist... gibt 0 zurück wenn keine übereinstimmung gefunden wurde.
hope that helps
mahlzeit
-
27.02.02 14:17 #7
thx für die ausführliche erklärung ******
nun ****ts auch...
ps: nice nickname (tarantino forever
)
----------------------------------
by black-dog
If you hold back anything, I'll kill ya.
If you bend the truth or I think your bending the truth, I'll kill ya.
If you forget anything I'll kill ya.
In fact, you're gonna have to work very hard to stay alive.
Now, do you understand everything I've said? Because if you don't, I'll kill ya.
Ähnliche Themen
-
Bilder aus Ordner auslesen
Von mkdgf im Forum PHPAntworten: 22Letzter Beitrag: 13.09.09, 20:34 -
Bilder Ordner auslesen !
Von louna im Forum PHPAntworten: 3Letzter Beitrag: 04.12.08, 20:26 -
Bilder aus Ordner auslesen
Von Falloutboy6 im Forum PHPAntworten: 3Letzter Beitrag: 15.11.08, 14:14 -
Bilder aus Ordner auslesen und darstellen
Von _root im Forum PHPAntworten: 8Letzter Beitrag: 03.10.08, 10:37 -
Bilder Ordner Auslesen mittels PHP
Von josDesign im Forum PHPAntworten: 6Letzter Beitrag: 09.01.04, 12:01





Zitieren
Login





