Solved

ASPUpload SetMaxSize syntax problem

Posted on 2004-10-08
8
687 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:dba123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 1

Author Comment

by:dba123
ID: 12265171
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.
0
 
LVL 15

Expert Comment

by:gladxml
ID: 12265176
take out the = sign

upl.SetMaxSize = 3000000, True


it must be

upl.SetMaxSize 3000000, True

0
 
LVL 15

Accepted Solution

by:
gladxml earned 500 total points
ID: 12265185
I think your syntax is wrong base on the link that you have provided.

http://www.aspupload.com/object_upload.html#SetMaxSize

The link state below and syntax as well regrading the SetmaxSize

Sub SetMaxSize (MaxSize As Long, Optional Reject)
Specified the maximum allowed size of the individual files to be uploaded. Reject specifies whether files larger than MaxSize should be rejected (if set to True) or truncated (if set to False or omitted).
Usage:

Upload.SetMaxSize 150000, True

Happy programming...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dba123
ID: 12265196
how stupid, didn't even see the =...duh
0
 
LVL 1

Author Comment

by:dba123
ID: 12265201
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?
0
 
LVL 1

Author Comment

by:dba123
ID: 12265215
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.
0
 
LVL 1

Author Comment

by:dba123
ID: 12265216
I'm starting a new thread.
0
 
LVL 15

Expert Comment

by:gladxml
ID: 12265482
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...

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question