View Single Post
  #1 (permalink)  
Old May 10th, 2005, 11:36 AM
DolphinBay DolphinBay is offline
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DolphinBay
Default The process cannot access the file...

Good morning to you all....

I am getting the following error after I upload a file through ASP.NET, and then try to delete it:

The process cannot access the file "530.gif" because it is being used by another process.

When I kill the aspnet_wp.exe process I once again have access to manipulate the file.  I have scoured the Net to try and find a solution to no avail.  Anyone have any ideas?  Many thanks in advance.  Please find the code below.

Regards,
Eric

'Compile new file name
Dim sNFile As String = Request.QueryString("cid") & Path.GetExtension(sPath)
Dim sNPath As String = cfg.setting("PHYSICAL_PATH") & "data\" & sNFile
'Save file to server
Try
   newImg.PostedFile.SaveAs(sNPath)
Catch ex As Exception
   tStatus.Text = ex.Message
End Try
newImg.Dispose()



Dolphin Bay, Inc. -- turning visions into eReality(tm) -- West Palm Beach, FL
Website Design, Internet Strategy, Search Engine Marketing

www.dphin.com