Skip to main content
Inspiring
November 1, 2008
Answered

Classic ASP validate form input File type

  • November 1, 2008
  • 1 reply
  • 1876 views
I need to know how to check if is a value is in the input field of type file in classic ASP. The input field name and id is file, and type is file. The form type is multipart/form-data and name form1.

I am using Upload.asp object by Jacob Gilley to handle my uploading. If the user submits without selecting a file to upload; the site errors out. The user should have the option to submit with or without a file. I need to validate on the server side.

I try
len(Uploader.form("file"))) > 3

Thanks for any help
David Pearson
This topic has been closed for replies.
Correct answer DEPearson
I found a solution, posting in case somebody else has the same problem.
if ( Uploader.Files.Count > 0 ) then
'do file processing
....
end if

Thanks all
David Pearson

1 reply

DEPearsonAuthorCorrect answer
Inspiring
November 1, 2008
I found a solution, posting in case somebody else has the same problem.
if ( Uploader.Files.Count > 0 ) then
'do file processing
....
end if

Thanks all
David Pearson