Chiisoft ASP - Chili!Upload problem.....

Discussion in 'ASP General' started by David, Feb 3, 2004.

  1. David

    David Guest

    Hi,

    i'm using a Chilisoft ASP component - Chili!Upload

    I have a form as such:

    ___________________________

    <FORM ACTION="getfile_lnx.asp" METHOD="POST" ENCTYPE="multipart/form-data">

    <INPUT TYPE="FILE" NAME="FILE" size="70">

    <INPUT TYPE="SUBMIT" VALUE="Upload">

    </FORM>

    ___________________________

    This is then submitted to :

    Set fbase = Server.CreateObject("Chili.Upload.1")

    Response.Expires = 0

    fbase.SizeLimit = 500000

    fbase.AllowOverwrite = false

    fullpath = fbase.SourceFileName


    ____________________________

    If the user presses the upload button without first selecting a file I get an error:

    Chili.Upload.1 error '80020009'

    Filename is empty. No file was selected


    However I try to catch this error, I just cannot.

    Please can you help me get around this.


    Thanks


    David
     
    David, Feb 3, 2004
    #1
    1. Advertising

  2. David

    Ray at Guest

    "David" <> wrote in message
    news:...

    > Set fbase = Server.CreateObject("Chili.Upload.1")


    > If the user presses the upload button without first selecting a file I get

    an error:
    >
    > Chili.Upload.1 error '80020009'
    >
    > Filename is empty. No file was selected



    Does this object have a count property or a count property of a files
    collection or something?

    Response.Write fbase.count
    Response.Write fbase.files.count

    I'm just guessing about this. I'd imagine this this is covered in the
    documentation for this component. Have you checked there for a count
    property? Or perhaps if not, there's a filesize property that you can check
    to see if it's <= 0. It appears the documentation is here.
    http://docs.sun.com/source/817-2514-10/Ch13_SpicePack68.html

    Ray at work
     
    Ray at, Feb 3, 2004
    #2
    1. Advertising

  3. David

    David Gordon Guest

    Ray,

    Thanks for your reply,

    I have tried testing against the following by saying if the size = 0 or
    filename = "", but still nothing works.

    Chili!Upload FileSize Property (Read Only)
    and
    Chili!Upload SourceFileName Property (Read Only)

    I just cannot trap the error ?

    Do you know anyone who has managed this.


    Thanks

    David






    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    David Gordon, Feb 3, 2004
    #3
  4. David

    Ray at Guest

    No, I don't know anyone who's using Chilisoft stuff and that virtual ASP
    thing. Does Chilisoft support On Error Resume Next?

    Ray at work

    "David Gordon" <> wrote in message
    news:...
    > Ray,
    >
    > Thanks for your reply,
    >
    > I have tried testing against the following by saying if the size = 0 or
    > filename = "", but still nothing works.
    >
    > Chili!Upload FileSize Property (Read Only)
    > and
    > Chili!Upload SourceFileName Property (Read Only)
    >
    > I just cannot trap the error ?
    >
    > Do you know anyone who has managed this.
    >
    >
    > Thanks
    >
    > David
    >
    >
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Ray at, Feb 3, 2004
    #4
  5. David

    Roland Hall Guest

    "David" wrote:
    : <FORM ACTION="getfile_lnx.asp" METHOD="POST"
    ENCTYPE="multipart/form-data">
    : <INPUT TYPE="FILE" NAME="FILE" size="70">
    : <INPUT TYPE="SUBMIT" VALUE="Upload">
    : </FORM>

    : This is then submitted to :
    : Set fbase = Server.CreateObject("Chili.Upload.1")
    : Response.Expires = 0
    : fbase.SizeLimit = 500000
    : fbase.AllowOverwrite = false
    : fullpath = fbase.SourceFileName

    : If the user presses the upload button without first selecting a file I get
    an error:
    : Chili.Upload.1 error '80020009'
    : Filename is empty. No file was selected

    Try:

    <script type="text/javascript">
    function validate() {
    if(document.forms[0].elements[0].value=="") {
    alert("No file to upload.\nPlease browse and select a file before
    trying to upload.");
    document.forms[0].elements[0].focus();
    return false;
    } else {
    document.forms[0].submit();
    return true;
    }
    }
    </script>
    </head>
    <body>
    <FORM ACTION="getfile_lnx.asp" METHOD="POST" ENCTYPE="multipart/form-data"
    onSubmit="return validate()">
    <INPUT TYPE="FILE" NAME="FILE" size="70">
    <INPUT TYPE="SUBMIT" VALUE="Upload">
    </FORM>

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Feb 3, 2004
    #5
  6. David

    David Gordon Guest

    Ray,


    Nice one,
    I would have never thought of using 'On Error Resume Next'.
    I tried it, changed my code around and voila... !

    Have a drink on me....Thanks again.

    David


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    David Gordon, Feb 4, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,548
    Bruce Barker
    Aug 3, 2005
  2. Heather Fraser
    Replies:
    0
    Views:
    654
    Heather Fraser
    Jul 5, 2004
  3. Replies:
    1
    Views:
    959
    Gabriel Genellina
    Nov 25, 2006
  4. Prakash
    Replies:
    3
    Views:
    485
    Ray at
    Nov 12, 2003
  5. vipin
    Replies:
    0
    Views:
    134
    vipin
    Jul 14, 2006
Loading...

Share This Page