Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:38 AM
David
Guest
 
Posts: n/a
Default Chiisoft ASP - Chili!Upload problem.....

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
  #2  
Old July 19th, 2005, 11:39 AM
Ray at
Guest
 
Posts: n/a
Default Re: Chiisoft ASP - Chili!Upload problem.....


"David" <david@scene-double.co.uk> wrote in message
news:c178e3e8.0402030717.56d16325@posting.google.c om...
[color=blue]
> Set fbase = Server.CreateObject("Chili.Upload.1")[/color]
[color=blue]
> If the user presses the upload button without first selecting a file I get[/color]
an error:[color=blue]
>
> Chili.Upload.1 error '80020009'
>
> Filename is empty. No file was selected[/color]


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

Ray at work


  #3  
Old July 19th, 2005, 11:39 AM
David Gordon
Guest
 
Posts: n/a
Default Re: Chiisoft ASP - Chili!Upload problem.....

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!
  #4  
Old July 19th, 2005, 11:39 AM
Ray at
Guest
 
Posts: n/a
Default Re: Chiisoft ASP - Chili!Upload problem.....

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" <david@scene-double.co.uk> wrote in message
news:eroRr9n6DHA.632@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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![/color]


  #5  
Old July 19th, 2005, 11:39 AM
Roland Hall
Guest
 
Posts: n/a
Default Re: Chiisoft ASP - Chili!Upload problem.....

"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


  #6  
Old July 19th, 2005, 11:40 AM
David Gordon
Guest
 
Posts: n/a
Default Re: Chiisoft ASP - Chili!Upload problem.....


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!
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles