Click to See Complete Forum and Search --> : Newbie: help needed to check for file string.


jammer20002
04-30-2005, 03:46 PM
I'm new to ASP... still trying to find my way around.

I have a script that sends an email after the user fills in the fields.
And... it has has a file attachment thing that allows you to attach a file to the email.
I've managed to get this working.

But... I still have a problem...
I want my end users to be able to send an email without having to attach a file.
The code seems to break down when no file is attached.

So... I need the code needed to check if something exists in the file thing on the HTML form.

I have the following code:

For Each File in Upload.Files
filename = returnFileName(File.Path)

I assume I need to check if something exists in the file field before the above is executed?

Any help would be appreciated.

Thanks.


Jam

phpnovice
04-30-2005, 04:57 PM
Is this ASP.NET? ...or, are you using a 3rd-party File Upload process? I ask, because Classic ASP has nothing like what you're showing for your code. Otherwise... The For Each appears to be returning a File object. What are the other properties of this File object?