You are viewing limited content. For full access, please sign in.

Question

Question

Error when uploading document: The file is being used by another process.

asked on April 7, 2014 Show version history

Hi,

 

Can somebody help me with the error as shown below?

 

Error Log:

"System.IO.IOException: The process cannot access the file 'C:\Windows\TEMP\vilgb3yp.s5l' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Delete(String path)
   at Laserfiche.DocumentServices.DocumentImporter.InternalImportImages(Stream imageStream, PageRange pagesToImport)
   at Laserfiche.DocumentServices.DocumentImporter.ImportImages(Stream imageStream)"

 

I am using "9.0.0.506" Laserfiche dlls. Laserfiche server is 9.0 and runtime SDK is 9.0 x64. The OS is Windows Server 2008 R2.

 

Application is running as WebService in IIS 7.5. File type that application uploading is TIF.

 

In the system, there was two runtime SDKs (8.0 and 9.0). I have uninstalled the 8.0 SDK runtime and restart the Application Pool. And the error is still exist.

 

 

I just wonder what is causing the error and how can I solve this error?

 

Thanks in advance

0 0

Answer

SELECTED ANSWER
replied on April 10, 2014

Hi,

 

It works when superadmin is used. The user that was using has not been set with Access Rights properly. The user has browser Rights but not Read and Write Access Rights.

 

Just the error was confusing.

 

Thanks all

 

Rdmf-log.JPG
Rdmf-log.JPG (306.91 KB)
0 0

Replies

replied on April 8, 2014

Can you open a support case and attach the sample image? From the DocumentImporter code, it looks possible that if there is an error importing the image, the file stream is not properly closed. So that could be the error you're seeing. But I can't tell for sure without a sample image.

0 0
replied on April 8, 2014 Show version history

EDIT: To give you the short version, the system is saying it can't access the file you're trying to import. Below I have a few troubleshooting steps you could try.

 

Open the image you're trying to import in your photo viewer (Windows Photoviewer is what I use) to make sure the image isn't corrupt or locked, etc. Afterwards, close the photo viewer. Make a copy of the image and do the same thing. Reboot the system. Once rebooted, run your program and check to see if you can import the copy you made of the image. Check with other images or file types as well. The ImportImages function will work with a small assortment of picture filetypes. If the other files don't give you this issue, the file is likely locked by some other process and the reboot should have solved your issue, otherwise the file is corrupt. If all of the pictures you try to import end up giving this error, likely there is a bug in your code causing it to terminate unexpectedly.

 

Another thing you could do to troubleshoot whether the file is at fault, or your program, is to do a regular image import with the Laserfiche Client. If the image imports when using the client, but not when using your program, your program is likely at fault. Again, it would be prudent to reboot immediately before trying this, so as to clear any locks the file might have on it from a runaway process.

0 0
replied on April 8, 2014

Hi,

I just wonder what is this file "vilgb3yp.s5l" in C:\Windows\TEMP folder.

 

My program was working and suddenly I am getting this error.

 

0 0
replied on April 9, 2014

Hi Cole,

I have restarted the system but I still the same problem.

But when I try to open the file that is causing error as shown my log file. It said the file is open by w3wp.exe. Since my application is web service there is something to do with w3wp.

 

I have not got the image file yet.

RDMF-.JPG
RDMF-.JPG (67.02 KB)
0 0
replied on April 9, 2014 Show version history

Could you post the relevant code from your application? It would help to see how you go about the import process.

 

It said the file is open by w3wp.exe

 

This tells me that your program is what's locking the file, so it must have something to do with how your program imports. Probably an unhandled exception or something along those lines.

0 0
replied on April 9, 2014

DocumentImporter uses some temp files during the import process.  In certain failure cases, it doesn't properly close the file before it tries to delete it.  Unfortunately, that exception obscures the original one, which is likely about an error while reading the image.  There's not much you can do to troubleshoot this on your own, you should open a support case and attach the file.

2 0
SELECTED ANSWER
replied on April 10, 2014

Hi,

 

It works when superadmin is used. The user that was using has not been set with Access Rights properly. The user has browser Rights but not Read and Write Access Rights.

 

Just the error was confusing.

 

Thanks all

 

Rdmf-log.JPG
Rdmf-log.JPG (306.91 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.