Link to home
Start Free TrialLog in
Avatar of dba123
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("ASPSimpleUpload.Upload")
       upl.SetMaxSize = 3000000, True
       file_name = upl.ExtractFileName(upl.Form("upload"))

      If isValidFile(file_name) then
             If Len(upl.Form("upload")) > 0 and isFileSizeOK(upl.OriginalSize) 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(strSQL)
                   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
Avatar of dba123
dba123

ASKER

the ISP I am using says they are using Simple ASP Upload.  I asked them for the actual site and they gave me this:

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.
take out the = sign

upl.SetMaxSize = 3000000, True


it must be

upl.SetMaxSize 3000000, True

ASKER CERTIFIED SOLUTION
Avatar of gladxml
gladxml

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dba123

ASKER

how stupid, didn't even see the =...duh
Avatar of dba123

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?
Avatar of dba123

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.
Avatar of dba123

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...