Sitecore has described how to create media items by yourself on SDN a while ago. Some how this code was broken while uploading JPG-files larger then 100kb. As I’m currently working on the location fo our customer and they’ve got a lot of network overhead(they are using Novell all over the place…) and the exception told me that the Uploaded file was closed, I decided to check the limits configured in our Web.config.
The httpRuntime Element has a lot of settings which influence the way they are connected to the end-user. I’ve played a little with the maxRequestLength and executionTimeOut. But unfortunetely it didn’t work. Digging in my memory about the specific problem, I remembert that JPG is like, every image format, block based. This might could have something to do with the issue.
There’s a requestLengthDiskThreshold in the httpRuntime. The default size is extremely low(256bytes!). After changing this value to 1kb(1024), it worked again like a charm.
So when you have some issues uploading. Try to add the requestLengthDiskThreshold-parameter to your web.config! I’ll ask the Sitecore Documentation team to add this to the page mentioned above.

Hi Alex! I’m a technical writer at Sitecore
Is this the correct way to add the parameter?
Please confirm this and i’ll add a note on SDN.
ops.. my previous comment was posted without the code.. Another try:
httpRuntime maxRequestLength=”16384″ executionTimeout=”600″ requestLengthDiskThreshold=”1024″
Hello Alexander,
You are totally right. It is configured in that way in our Web.config.
Thank you for your quick action.
- Alex
Thanks! The note is added:
http://sdn5.sitecore.net/Snippets/Item%20Handling/Media%20Library/Creating%20Media%20Items%20in%20Database.aspx
Cool observation, – as always. Alex, – well done.