weee
10-13-2004, 03:09 PM
Hi There.
I have a loop that uploads photos. The thing is that I'm trying to run the loop and also get the name of each photo that I'm uploading (so I can insert into a database).
For Each File in Upload.Files
Set File = Upload.Files(1)
If File.ImageType = "UNKNOWN" Then
File.Delete
Else
Height = File.ImageHeight
Width = File.ImageWidth
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Path = Server.MapPath("images/") & "/" & File.ExtractFileName
Jpeg.Open Path
Jpeg.OpenBinary Upload.Files(1).Binary
Jpeg.PreserveAspectRatio = True
Jpeg.Height = 100
Jpeg.Width = 200
Jpeg.Save "D:\html\users\images\small\" & File.Filename
Jpeg.OpenBinary Upload.Files(1).Binary
Jpeg.PreserveAspectRatio = True
Jpeg.Height = 200
Jpeg.Width = 400
Jpeg.Save "D:\html\users\images\big\" & File.Filename
End If
Next
I'll have something like that:
image1 = File.ExtractFileName
I'll get the name of the first photo that I'm uploading but I want to get the name of all of'em. I tried so many things... what can I do?
Please help.
Thanks a lot!
I have a loop that uploads photos. The thing is that I'm trying to run the loop and also get the name of each photo that I'm uploading (so I can insert into a database).
For Each File in Upload.Files
Set File = Upload.Files(1)
If File.ImageType = "UNKNOWN" Then
File.Delete
Else
Height = File.ImageHeight
Width = File.ImageWidth
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Path = Server.MapPath("images/") & "/" & File.ExtractFileName
Jpeg.Open Path
Jpeg.OpenBinary Upload.Files(1).Binary
Jpeg.PreserveAspectRatio = True
Jpeg.Height = 100
Jpeg.Width = 200
Jpeg.Save "D:\html\users\images\small\" & File.Filename
Jpeg.OpenBinary Upload.Files(1).Binary
Jpeg.PreserveAspectRatio = True
Jpeg.Height = 200
Jpeg.Width = 400
Jpeg.Save "D:\html\users\images\big\" & File.Filename
End If
Next
I'll have something like that:
image1 = File.ExtractFileName
I'll get the name of the first photo that I'm uploading but I want to get the name of all of'em. I tried so many things... what can I do?
Please help.
Thanks a lot!