R
RSH
Hi,
I have an ASP .Net web page that creates a temp directory on the server then
it is using the File.Copy command to move a file to a temp download
directory, Then I am doing a response.Redirect to that URL.
The problem is that whenever I run the page the script fails on the
File.Copy() command everytime with an error of:
The process cannot access the file
"c:\inetpub\wwwroot\TestPages\Downloads\12431234051920061359\585F56645D4740714337170A043006180038060C017E081A10.doc"
because it is being used by another process.
This shouldn't be a permissions issue because I have full control to
everyone just for testing purposes.
Here is the code snippet:
strTempdirectory = strFileSystemPath & CompanyID & dDateStamp
strFile1 = strFileSystemPath & strFileName
strFile2 = strTempdirectory & "\" & strFileName
If Not Directory.Exists(strTempdirectory) Then
Directory.CreateDirectory(strTempdirectory)
End If
If File.Exists(strFile2) Then
File.Delete(strFile2)
End If
Fails here: ---> File.Copy(strFile1, strFile2, False)
strRedirectPath = strHttpPath & CompanyID & dDateStamp & "/" & strFileName
Response.Redirect(strRedirectPath)
Thanks in advance for any help you might be able to offer.
Ron
I have an ASP .Net web page that creates a temp directory on the server then
it is using the File.Copy command to move a file to a temp download
directory, Then I am doing a response.Redirect to that URL.
The problem is that whenever I run the page the script fails on the
File.Copy() command everytime with an error of:
The process cannot access the file
"c:\inetpub\wwwroot\TestPages\Downloads\12431234051920061359\585F56645D4740714337170A043006180038060C017E081A10.doc"
because it is being used by another process.
This shouldn't be a permissions issue because I have full control to
everyone just for testing purposes.
Here is the code snippet:
strTempdirectory = strFileSystemPath & CompanyID & dDateStamp
strFile1 = strFileSystemPath & strFileName
strFile2 = strTempdirectory & "\" & strFileName
If Not Directory.Exists(strTempdirectory) Then
Directory.CreateDirectory(strTempdirectory)
End If
If File.Exists(strFile2) Then
File.Delete(strFile2)
End If
Fails here: ---> File.Copy(strFile1, strFile2, False)
strRedirectPath = strHttpPath & CompanyID & dDateStamp & "/" & strFileName
Response.Redirect(strRedirectPath)
Thanks in advance for any help you might be able to offer.
Ron