If you’re using Microsoft ASP.NET AjaxToolkit’s AsyncFileUpload placed inside a webform nested in a master page, chances are you’ll be faced with a baffling error message “The file attached is invalid”. No amount of manual troubleshooting and breakpoint-ing help because there’s no complete error messages (or even any that makes sense).

The reason: The client side script got confused because it couldn’t find the predicted ClientID.

The solution: Add ClientIDMode=”AutoID” to your markup!

5 Responses to “Fix: AsyncFileUpload always return “The file attached is invalid””

  1. Phil Says:

    …which works like a charm, except that I then want to reference that control and I don’t know what the ID is.

  2. Himanshu Says:

    hii..thnx 4 ur post…!! it realy works..!!

  3. Sachin Srivastava Says:

    Hi,
    Bro it really works.
    Thanks a lot.

  4. Vivek Says:

    Thanks bro! Worked like a charm!

  5. Ismail Says:

    Thanks a lot

Leave a Reply