Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp UPLOAD obj - VB to JSCRIPT

Status
Not open for further replies.

JimFL

Programmer
Joined
Jun 17, 2005
Messages
131
Location
GB
Hi,

I am struggling to find support for the javascript with the ASP object. All notes on the supporting documentation are in VBSCRIPT:


Does anyone know how I would write the following code in ASP javascript?

CODE AS FOLLOWS:

For Each File in Upload.Files

If File.ImageType <> "GIF" and File.ImageType <> "JPG" Then
errDesc = "GIF or JPG files only please!"
file.Delete
imgErr = true
Exit For
End If
If File.ImageWidth > 150 Then
errDesc = "Image width cannot exceed 150 pixels."
file.Delete
imgErr = true
Exit For
End If

If File.ImageHeight > 200 Then
errDesc = "Image height cannot exceed 200 pixels."
file.Delete
imgErr = true
Exit For
End If


Next

Can anybody help on this? The problem lies on the for each statement.

 
JScript doesn't handle binary data well, so you'll need to use something other than a pure ASP solution, something like ASPUpload. You didn't specify which "ASP object" you're using.

Lee
 
I am using ASP Persits.Upload object. But could also use the Softartisans fileup object also as that is available to me.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top