dba123
asked on
ASPUpload SetMaxSize syntax problem
the code below produces this ASP error:
Expected end of statement
/chav.asp, line 148
upl.SetMaxSize = 3000000, True
-------------------------- ---------- ---------- ---------- ---
My sub:
Sub UploadFile
Dim upl, NewFileName
Set upl = Server.CreateObject("ASPSi mpleUpload .Upload")
upl.SetMaxSize = 3000000, True
file_name = upl.ExtractFileName(upl.Fo rm("upload "))
If isValidFile(file_name) then
If Len(upl.Form("upload")) > 0 and isFileSizeOK(upl.OriginalS ize) Then
NewFileName = "/Uploads/" & file_name
If upl.SaveToWeb("upload", NewFileName) Then
Response.Write("Your file was successfully uploaded.")
strSQL = "sp_AddUploadedFile"
strSQL = strSQL & " @RegID = '" & Session("regID") & "',"
strSQL = strSQL & " @FileName = '" & file_name
strSQL = strSQL & " @DateUploaded = '" & Now() & "'"
Set Query = objConnection.Execute(strS QL)
Else
Response.Write("There was an error uploading your avitar file.")
End If
else
Response.Write ("Your file size must be 30 kb or less")
End If
else
Response.Write("Your file name type is not a .jpg, .jpeg, .gif, or .bmp")
End If
End Sub
Expected end of statement
/chav.asp, line 148
upl.SetMaxSize = 3000000, True
--------------------------
My sub:
Sub UploadFile
Dim upl, NewFileName
Set upl = Server.CreateObject("ASPSi
upl.SetMaxSize = 3000000, True
file_name = upl.ExtractFileName(upl.Fo
If isValidFile(file_name) then
If Len(upl.Form("upload")) > 0 and isFileSizeOK(upl.OriginalS
NewFileName = "/Uploads/" & file_name
If upl.SaveToWeb("upload", NewFileName) Then
Response.Write("Your file was successfully uploaded.")
strSQL = "sp_AddUploadedFile"
strSQL = strSQL & " @RegID = '" & Session("regID") & "',"
strSQL = strSQL & " @FileName = '" & file_name
strSQL = strSQL & " @DateUploaded = '" & Now() & "'"
Set Query = objConnection.Execute(strS
Else
Response.Write("There was an error uploading your avitar file.")
End If
else
Response.Write ("Your file size must be 30 kb or less")
End If
else
Response.Write("Your file name type is not a .jpg, .jpeg, .gif, or .bmp")
End If
End Sub
take out the = sign
upl.SetMaxSize = 3000000, True
it must be
upl.SetMaxSize 3000000, True
upl.SetMaxSize = 3000000, True
it must be
upl.SetMaxSize 3000000, True
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how stupid, didn't even see the =...duh
ASKER
actually now the error is:
Object doesn't support this property or method: 'upl.SetMaxSize'
again, I don't think this is the right webpage for the syntax. I also see that the orginal makers of Simple ASP Upload are no longer around?
Object doesn't support this property or method: 'upl.SetMaxSize'
again, I don't think this is the right webpage for the syntax. I also see that the orginal makers of Simple ASP Upload are no longer around?
ASKER
ok, the ISP does have ASPUpload installed afterall....as well as Simple ASP Upload so my object should have no problems. This sub is coded in ASP Simple Upload so I need to somehow find that damn page for the objects....wherever the hell this exists now that the makers must have skipped out.
ASKER
I'm starting a new thread.
dba123,
Have you tried it in your worstation.
Also you can asked your ISP if they do support ASPUpload and Simple ASP Upload if they dont encounter the same problem as you do.
Happy programming...
Have you tried it in your worstation.
Also you can asked your ISP if they do support ASPUpload and Simple ASP Upload if they dont encounter the same problem as you do.
Happy programming...
ASKER
http://www.aspupload.com/object_upload.html
I browsed the site which is where I got that function to set the upload size limit but now that I look at that site, I see no "SaveToWeb" function like I have in my sub. The file upload worked just fine before I added the if statements for the file size and such. So I dont' know if this is the actual site I should be referencing here....maybe it doesn't understand that function SetMaxSize that I'm using here.