How to free resources used by HttpPostedFileBase?

After downloading the file, I try to delete it from my PC, but it says that the file is being used.

What code am I missing to free a file for deletion?

+6
asp.net-mvc
source share
1 answer

You may need to close the InputStream manually after reading it to make sure that it is not kept open until the HttpPostedFileBase is garbage collected.

0
source

All Articles