Check for SAFileup Submit Form

Posted on 2007-08-08
Last Modified: 2013-11-05
I have the below form and code but the file never gets uploaded because the "if len(upl.Form("subUpload")) <> 0 then" is never true. How do I check that the form as been submitted?

Set upl = Server.CreateObject("SoftArtisans.FileUp")
if len(upl.Form("subUpload")) <> 0 then

    BadMsg = ""

    if upl.IsEmpty Then
        BadMsg = "I had problems uploading your file"
    end if

    if BadMsg <= " " then
        upl.Path = "e:\Database\"
        upl.Form("File1").SaveInVirtual "/Database/Something_temp.mdb"
        realPath = "E:\Database\"

' ----------------------------------The Form
<form method="Post" ENCTYPE="multipart/form-data" action="UploadDB.asp">

<center><font size="+3">Upload Database</font></center>
<!--  <img src="images/headers_retailerslogoin.gif" width="560" height="40" /> -->
<% If BadMsg > " " then %>
    <center><font color="red"><b><%=BadMsg%></b></font></center<br />
<% end if %>
  <table border="0" cellpadding="5" cellspacing="0">
            <td class="txtGreen12Bold">Database to Upload:</td><td><Input size="50" type="file" name="File1" value=""></td>
      <td colspan="2"><img src="images/spacer.gif" width="100%" height="1" /></td>
        <td><Input type="submit" name="subUpload" value="Upload"></td>
Question by:slamhound
    LVL 14

    Expert Comment

    I'd try if upl.Form("subUpload") then.

    Their documentation is pretty poor. If you're interested, I suggest using File Upload Object from It is much better one, and pure ASP. It has many samples within it, and a good documentation.

    LVL 14

    Accepted Solution

    upl.Form("subUpload").TotalBytes>0 might work as well.
    LVL 10

    Author Comment

    Your first suggestion turned up False every time while your second suggestion gave a "Object required: '[undefined]'" error message on the IF statement.
    LVL 10

    Author Comment

    BUT upl.TotalBytes>0 worked!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now