Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Chiisoft ASP - Chili!Upload problem.....

Reply
Thread Tools

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

 
 
David
Guest
Posts: n/a
 
      02-03-2004
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
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      02-03-2004

"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...

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

Ray at work


 
Reply With Quote
 
 
 
 
David Gordon
Guest
Posts: n/a
 
      02-03-2004
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!
 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-03-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      02-03-2004
"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


 
Reply With Quote
 
David Gordon
Guest
Posts: n/a
 
      02-04-2004

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!
 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global filter to redirect asp (old asp!) pages on asp.net site Daves ASP .Net 2 05-31-2006 08:33 AM
2.0: asp:Menu, asp:XmlDataSource, asp:PlaceHolder R.A.M. ASP .Net 1 03-29-2006 07:55 AM
[ASP.NET1.1]Should I kill the ASP.NET worker process after recompilingmy ASP.NET webservice? Andrea Raimondi ASP .Net 1 02-06-2006 08:10 AM
ASP.Net cookie -> ASP -> ASP.Net Ben ASP .Net 3 05-28-2004 03:35 PM
LOOP through an ASP form's pages (not ASP.NET - ASP classic) David A. Beck ASP General 10 04-13-2004 05:38 PM



Advertisments