"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