O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous file writes

We've now seen how to asynchronously access the database and a web service. Another area where asynchronous coding may bring performance benefits is writing files to disc after they have been uploaded using the FileUpload control.

Synchronous version

You'll find this code in the downloaded code bundle in the folder ThreadStarvation_FileWrite_Sync. When you open the website in Visual Studio, you'll find that it stores uploaded files in a folder images. When you publish the website, to enable the website to write files into that folder, give user IIS_IUSRS modify permission to that folder:

  1. Right-click on the images folder. Click on Properties | Security | Edit.
  2. Select IIS_IUSRS in upper-pane (add it if it isn't shown).
  3. Check ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required