?
Solved

ASPUpload SetMaxSize syntax problem

Posted on 2004-10-08
8
Medium Priority
?
693 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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