473,508 Members | 2,240 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The process cannot access the file because it is being used by another process

nightangel
1 New Member
Hi dude,what i was done in my application is uploading a image file to my server using FTP, it work great when pushing a file into the server path using FTP.
The problem i met now is i need to do a resuming for the file uploading if the client connection or server connection is down.

E.g: Sunset.jpg (500KB) when i upload until half of it, (332KB in the server) and unplug my connection, it will looping and try to connect to the server, after i plug back, the FTP login is success, but it throw me an exception, say that: Sunset.jpg "The process cannot access the file because it is being used by another process".

How can i solve the problem? how do i close the file opening in the server?

Expand|Select|Wrap|Line Numbers
  1. SendCommand("STOR " & Path.GetFileName(sFileName))
  2.  
  3. ' Send a command to the FTP Server.
  4. Private Sub SendCommand(ByVal sCommand As String)
  5.         sCommand = sCommand & ControlChars.CrLf
  6.         Dim cmdbytes As Byte() = ASCII.GetBytes(sCommand)
  7.  
  8.         m_objClientSocket.Send(cmdbytes, cmdbytes.Length, 0)
  9.  
  10.         ReadReply()
  11. End Sub
  12.  
  13.  ' Read the reply from the FTP Server
  14. Private Sub ReadReply()
  15.         m_sMes = ""
  16.         m_sReply = ReadLine()
  17.         m_iRetValue = Int32.Parse(m_sReply.Substring(0, 3))
  18. End Sub
  19.  
  20. ' Read a line from the server.
  21. Private Function ReadLine() As String
  22.  
  23.         Dim seperator As Char = ControlChars.Lf
  24.         Dim mess() As String
  25.  
  26.         If (bClearMes) Then
  27.             m_sMes = ""
  28.         End If
  29.         Do While (True)
  30.             Array.Clear(m_aBuffer, 0, BLOCK_SIZE)
  31.             m_iBytes = m_objClientSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
  32.             m_sMes += ASCII.GetString(m_aBuffer, 0, m_iBytes)
  33.  
When the program is reading the line from the server, it replying a message from " m_sMes " : Sunset.jpg "The process cannot access the file because it is being used by another process".
Apr 20 '07 #1
0 2949

Sign in to post your reply or Sign up for a free account.

Similar topics

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...
4
8290
by: Mountain Bikn' Guy | last post by:
I am having serious problems with the following IDE bug: Could not write to output file 'x.dll' -- 'The process cannot access the file because it is being used by another process. ' and BUG:...
2
7753
by: Raed Sawalha | last post by:
Hello , I have windows service which do listening to specified directory using FileSystemWatcher , on Created Event and Get all the files in the directory using Directory.GetFiles function then...
4
8828
by: Jerry | last post by:
I've inherited a system w/5 projects - I'll refer to them as P1 thru P5 - P5 being the executable... P1 has no dependents. P2 is dependant upon P1 P3 has no dependents. P4 is dependant upon P1,...
3
3774
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...
2
7082
by: Piyush | last post by:
Hi, I am getting the error "The process cannot access the file "C:\Documents and Settings\piyush\Desktop\200309181051.ktl" because it is being used by another process." when I try to open this...
0
1633
by: chris | last post by:
In VB6.0 I was using API calls for checking that a process has finished and then continue with other steps: var_process_number = Shell("wzunzip.exe -o " & """" & fld_ZIP_file_name & """" & " " &...
0
1768
by: imranabdulaziz | last post by:
Dear All, I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End I generated local mode report but as there was no printing option available . I assign...
3
3322
by: gracepaul | last post by:
hi, i got an exception while i m trying to zip/unzip a database inside the serverfolder System.IO.IOException: The process cannot access the file...
0
7231
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,...
0
7132
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...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
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...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
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,...
0
3211
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...
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
432
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...

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.