473,769 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot delete file from webserver...... process cannot access style error

I need some help here guys.... i have been simply trying to delete a file
from the webserver using asp.net

using the following code.

System.IO.File. Delete(FullPath );
however the error message i get is the following

The process cannot access the file
"e:\inetpub\www root\client_dev \brands\Product _images\1450.jp g" because it is
being used by another process.

What other process could be doing this? it is happening both on our dev box
AND up at our host...

in code i do not have any references to the file at all.... so there couldnt
be any locks that i am causing intentionally.. ..

what else could lock a file.... and if so how can i remove the lock so i can
DELETE the file..
Nov 19 '05 #1
4 2397
Is it possible that some other of your web pages is just showing this
picture, so that there's a lock caused by that?

HTH,
Axel Dahmen
-----------------
"news.microsoft .com" <dc******@hotma il.com> schrieb im Newsbeitrag
news:#m******** ******@TK2MSFTN GP15.phx.gbl...
I need some help here guys.... i have been simply trying to delete a file
from the webserver using asp.net

using the following code.

System.IO.File. Delete(FullPath );
however the error message i get is the following

The process cannot access the file
"e:\inetpub\www root\client_dev \brands\Product _images\1450.jp g" because it is being used by another process.

What other process could be doing this? it is happening both on our dev box AND up at our host...

in code i do not have any references to the file at all.... so there couldnt be any locks that i am causing intentionally.. ..

what else could lock a file.... and if so how can i remove the lock so i can DELETE the file..

Nov 19 '05 #2

"news.microsoft .com" <dc******@hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I need some help here guys.... i have been simply trying to delete a file
from the webserver using asp.net

using the following code.

System.IO.File. Delete(FullPath );
however the error message i get is the following

The process cannot access the file
"e:\inetpub\www root\client_dev \brands\Product _images\1450.jp g" because it is being used by another process.

What other process could be doing this? it is happening both on our dev box AND up at our host...

in code i do not have any references to the file at all.... so there couldnt be any locks that i am causing intentionally.. ..

what else could lock a file.... and if so how can i remove the lock so i can DELETE the file..

There is a good chance you have some unmanaged code that is opening the file
but not closing/disposing of it and therefore it is still in use. You need
to call the close or dispose method. Asp does not manage file operations in
many cases.

Mike
Nov 19 '05 #3
"news.microsoft .com" <dc******@hotma il.com> wrote in message news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
what else could lock a file.... and if so how can i remove the lock


If the dev box is XP, try opening a command prompt and running

openfiles /?

You need to activate it and re-boot, but this utility can be helpful
diagnosing what process is keeping the file(s) open. Other third-
party GUI tools exist that provide similar functionality.
Derek Harmon
Nov 19 '05 #4
I would like to know, whether you're uploading that File using
HTTPPost.SaveAs Method?

"news.microsoft .com" wrote:
I need some help here guys.... i have been simply trying to delete a file
from the webserver using asp.net

using the following code.

System.IO.File. Delete(FullPath );
however the error message i get is the following

The process cannot access the file
"e:\inetpub\www root\client_dev \brands\Product _images\1450.jp g" because it is
being used by another process.

What other process could be doing this? it is happening both on our dev box
AND up at our host...

in code i do not have any references to the file at all.... so there couldnt
be any locks that i am causing intentionally.. ..

what else could lock a file.... and if so how can i remove the lock so i can
DELETE the file..

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
58117
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they were going to look :) . Here is my current dilemma: I am having a strange problem with my ASP.NET application. I am building the application using Visual Basic .Net in Visual Studio.NET 2003. Lately, I have frequently been getting the following...
9
715
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit anyway).... Private Sub LogChange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs) If e.ChangeType = WatcherChangeTypes.Created Then
8
5481
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
3
3742
by: JeffM | last post by:
I have a .dat file on a remote server that seems to be locked. I have tried to FTP to it and delete it, rename it, copy over it and I get the error. "Could not copy temporary files to the output directory" Anybody have any idea why this file is locked? What do I have to do to release it? TIA ~jeff
3
3802
by: guoqi zheng | last post by:
Dear sir, There is an import tool on my web application, user can upload Ms Access file, the file is saved at a temp folder on the server. After the import is finished, for security reason, I need to delete the imported Ms Access file, however, I always get above error, "The process cannot access the file because it is being used by another process" I did close the datareader and connection object. What else can I do to delete this...
1
8902
by: Tod Birdsall | last post by:
I am using Microsoft Office Document Imaging (MODI) with great success. However, when execute the following code, I get the error "The process cannot access the file 'myFile.tif'" (File name has been shortened). Here is the code I am using: -- BEGIN CODE -- public class OCRUtil : IDisposable { const string FILENAME = "myFile.tif"; private MODI.Document doc = null;
0
420
by: ary | last post by:
hi all I have a problem with working file when i upload a file in IIS I can'd Delete it. if I try to delete it in debug mode , it successfully worked. my error message "the process cannot access the file "path\filename.jpg" because it is being used by another process".
3
3426
by: bluez | last post by:
I want to design a webpage where user can search the data from the database and list out the related records. Each of the record got a delete button which allow user to delete the record. Filename : search_student.php <?php include("../user_access/user_access_control.php"); include("../Database/database.php"); $searchStudentControl = new Access_user;
24
5081
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the same code, except a different name for the file. The Microsoft Jet database engine cannot open the file 'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.