By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

File Upload Issue

P: n/a
Our application uploads a file to go through some parsing. Towards the end
of the process, the application moves the file from the 'processing' folder
to an archive location. However, at times this move (a moveto) fails because
the file is in use by another process (we receive a System.IO.IOException).
This DOES NOT happen on every upload. Using the FileMon tool from
SysInternals, I viewed the process activity on any file dropped into the
processing folder. I found the w3wp.exe process (this is a Windows 2003
server) working on the uploaded file. Below are the last two event captures
for a single uploaded file.

1:01:20 PM w3wp.exe:2116 READ
D:\AT.File\AT.BatchWatchFiles\WatchDogDrop\Test Batch
File-3381829280.00969.csv SUCCESS Offset: 0 Length: 4096
1:06:06 PM w3wp.exe:2116 CLOSE
D:\AT.File\AT.BatchWatchFiles\WatchDogDrop\Test Batch
File-3381829280.00969.csv SUCCESS

As you can see, I have the last read statement (there is plenty more before
this read) and the close statement both from w3wp.exe. There is over 4
minutes between the two. However, I have seen the CLOSE execute within the
same second of the last read. Through my testing, the 4 minute delay is
unusally - any delay is in the 30 to 45 second range.

Is this normal processing for the Asp.Net file upload. Why does the CLOSE
occur right after the read on most uploads but for a few uploads the CLOSE
takes up to 4 minutes to execute? Do I need to check if there is any other
process or activity that has the file locked?

Thanks
Mar 2 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Are you sure you closing file yourself?
do not rely ongarbage collector. Always close it. Even if exception has
happened you still must close.

something like

try
{
open file......
......Do the Dew....
}
finally
{
close file
}

George

"Robert Strickland" <bs*********@comporium.netwrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...
Our application uploads a file to go through some parsing. Towards the end
of the process, the application moves the file from the 'processing'
folder to an archive location. However, at times this move (a moveto)
fails because the file is in use by another process (we receive a
System.IO.IOException). This DOES NOT happen on every upload. Using the
FileMon tool from SysInternals, I viewed the process activity on any file
dropped into the processing folder. I found the w3wp.exe process (this is
a Windows 2003 server) working on the uploaded file. Below are the last
two event captures for a single uploaded file.

1:01:20 PM w3wp.exe:2116 READ
D:\AT.File\AT.BatchWatchFiles\WatchDogDrop\Test Batch
File-3381829280.00969.csv SUCCESS Offset: 0 Length: 4096
1:06:06 PM w3wp.exe:2116 CLOSE
D:\AT.File\AT.BatchWatchFiles\WatchDogDrop\Test Batch
File-3381829280.00969.csv SUCCESS

As you can see, I have the last read statement (there is plenty more
before this read) and the close statement both from w3wp.exe. There is
over 4 minutes between the two. However, I have seen the CLOSE execute
within the same second of the last read. Through my testing, the 4 minute
delay is unusally - any delay is in the 30 to 45 second range.

Is this normal processing for the Asp.Net file upload. Why does the CLOSE
occur right after the read on most uploads but for a few uploads the CLOSE
takes up to 4 minutes to execute? Do I need to check if there is any other
process or activity that has the file locked?

Thanks

Mar 2 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.