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

D

David

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
 
R

Ray at

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
 
D

David Gordon

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
 
R

Ray at

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
 
R

Roland Hall

:
: <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
 
D

David Gordon

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top