dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Newbie: help needed to check for file string.

  1. #1
    Join Date
    Sep 2003
    Posts
    218

    Newbie: help needed to check for file string.

    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

  2. #2
    Join Date
    Dec 2004
    Posts
    8,637
    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles