Search Persits Software Knowledge Base

 

Article PS01032620

Object required: 'Upload.Files(...)' error

Problem Description

When uploading a file with AspUpload, the line of code

Response.Write Upload.Files("FILE1").Path

generates the following error in case no files were selected via the box <INPUT TYPE="FILE" NAME="FILE1"> :

Microsoft VBScript runtime (0x800A01A8)
Object required: 'Upload.Files(...)'

Solution

To check at run time whether a particular form item was used to select a file, the following syntax may be used:

Set File = Upload.Files("FILE1")
If File Is Nothing Then
  Response.Write "file not selected."
Else
  Response.Write File.Path
End If

Created: 2/8/2002 5:25:18 AM
Last Modified: 2/9/2002 3:28:40 PM

Copyright © Persits Software, Inc. 1998 - 2018
For technical support, write to support@persits.com.