Tomas
Tomas

Reputation: 18117

HttpContext.HttpRequest.files empty

I am using html form below and on my local computer trying to upload file to ASP.NET HTTPModule and read files using HttpContext.HttpRequest.files Unfortunately HttpContext.HttpRequest.files do not contain any files. Where is the problem?

<html>
<body>
    <form  action="http://localhost:2006/MyASPNETModule" method="post" enctype="multipart/form-data" > 
       Please choose file from your computer  <br />
    <input type="file">  
    <button id="btnConvert" type="submit">
        Convert</button>
    </form>
</body>
</html>

Upvotes: 1

Views: 1290

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039130

Give your file input a name:

<input type="file" name="file" /> 

Upvotes: 1

Related Questions