472,368 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,368 software developers and data experts.

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

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))
  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)
  8.         m_objClientSocket.Send(cmdbytes, cmdbytes.Length, 0)
  10.         ReadReply()
  11. End Sub
  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
  20. ' Read a line from the server.
  21. Private Function ReadLine() As String
  23.         Dim seperator As Char = ControlChars.Lf
  24.         Dim mess() As String
  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)
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 2826

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

Similar topics

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...
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:...
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...
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,...
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...
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...
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 & """" & " " &...
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...
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...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.