S
Sobhan Vezzu
Hi All,
Using a webpage I am uploading the file onto webserver. First time
it works fine. If I use the same file from second time it throws an
error.
Error:
"The process cannot access the file "<FileName>" because it is being
used by another process."
My code is as follows:
If Not (File1.PostedFile Is Nothing) Then
' Create new directory if not present
If Not (Directory.Exists(strDirPath)) Then
Directory.CreateDirectory(strDirPath)
End If
' Save the uploaded file in the directory
File1.PostedFile.SaveAs(strDirPath + "\" + strFileName)
End If
Any suggestions would be appreciated.
Regards
Sobhan
Using a webpage I am uploading the file onto webserver. First time
it works fine. If I use the same file from second time it throws an
error.
Error:
"The process cannot access the file "<FileName>" because it is being
used by another process."
My code is as follows:
If Not (File1.PostedFile Is Nothing) Then
' Create new directory if not present
If Not (Directory.Exists(strDirPath)) Then
Directory.CreateDirectory(strDirPath)
End If
' Save the uploaded file in the directory
File1.PostedFile.SaveAs(strDirPath + "\" + strFileName)
End If
Any suggestions would be appreciated.
Regards
Sobhan