2

I have read one article for Async file upload in ASP.NET here.

It is working till the .ashx file call but showing "context.Request.Files.Count" 0.

enter image description here

Can anyone help?

1 Answer 1

1

You need to add enctype="multipart/form-data" to the HTML form, like this:

<form enctype="multipart/form-data">

OR

YourForm.Attributes.Add("enctype", "multipart/form-data");

You also need to verify that your HTML <input> of type file has a name attribute, like this:

<input type="file" name="MyFileInput" />
Sign up to request clarification or add additional context in comments.

2 Comments

Hi Karl, Thank you for the reply. Everything is there including <form enctype="multipart/form-data"> and <input type="file" name="MyFileInput" /> any other missing things?
Is this a valid attribute (fileElementId: 'fileToUpload',) to pass file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.