File Upload Validation

Discussion in 'ASP .Net' started by Webmills, Apr 17, 2006.

  1. Webmills

    Webmills Guest

    Hi

    I have a form containing a

    File Upload Control,
    Required Field Validator (connected to the file upload control)
    RegularExpressionValidator (connected to the file upload control,
    validating the file types for upload)
    OK button, calling an event

    All four belong to the same validation group.

    My problem is this...

    When I submit the form, all validation works as expected and required.

    However, I would like to check for the existance of the file within the
    OK event and report back to the user if the file exists, cancelling the
    upload.

    When this happens, validation seems a bit off. The page is refreshed,
    the file upload control emptied (I assume automatically for security
    reasons) and RegularExpressionValidator is fired and reports false,
    even though the file upload field is blank! The RequiredFieldValidator
    does not fire.

    Any thoughts would be gratefully received!
     
    Webmills, Apr 17, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy

    Upload File - test for valid file type

    moondaddy, Feb 20, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    942
    Eric Lawrence [MSFT]
    Feb 20, 2004
  2. lawrence

    Upload file Check file size

    lawrence, Jun 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    9,519
    Craig Deelsnyder
    Jun 10, 2004
  3. HVG
    Replies:
    2
    Views:
    2,676
  4. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,093
    Bruce Barker
    Aug 3, 2005
  5. Heather Fraser
    Replies:
    0
    Views:
    827
    Heather Fraser
    Jul 5, 2004
  6. Replies:
    1
    Views:
    1,163
    Gabriel Genellina
    Nov 25, 2006
  7. Prakash
    Replies:
    3
    Views:
    666
    Ray at
    Nov 12, 2003
  8. Alejandrina

    File Upload Validation

    Alejandrina, Nov 24, 2003, in forum: Javascript
    Replies:
    0
    Views:
    162
    Alejandrina
    Nov 24, 2003
Loading...