Uploading the file to the same path on the server.
-
Using UploadFile control to upload file to the server fails, if I upload twice the file with the same name with exception that path is not accessible coming from either UploadFile control or from File.Delete if I'm trying to remove it before uploading it again. 1) Clicking [browse] button, selecting the file, uploading it with say UploadFile.Save("path\file.txt"), and do some processing on the file. 2) Clicking [browse] button, selecting the same file, I try to upload the same file.txt to exactly the same location on the server UploadFile.Save("path\file.txt"). And the exception is returned. I do not have such problems on my local computer.
Чесноков
-
Using UploadFile control to upload file to the server fails, if I upload twice the file with the same name with exception that path is not accessible coming from either UploadFile control or from File.Delete if I'm trying to remove it before uploading it again. 1) Clicking [browse] button, selecting the file, uploading it with say UploadFile.Save("path\file.txt"), and do some processing on the file. 2) Clicking [browse] button, selecting the same file, I try to upload the same file.txt to exactly the same location on the server UploadFile.Save("path\file.txt"). And the exception is returned. I do not have such problems on my local computer.
Чесноков
Always add the exception message in your questions..
-
Using UploadFile control to upload file to the server fails, if I upload twice the file with the same name with exception that path is not accessible coming from either UploadFile control or from File.Delete if I'm trying to remove it before uploading it again. 1) Clicking [browse] button, selecting the file, uploading it with say UploadFile.Save("path\file.txt"), and do some processing on the file. 2) Clicking [browse] button, selecting the same file, I try to upload the same file.txt to exactly the same location on the server UploadFile.Save("path\file.txt"). And the exception is returned. I do not have such problems on my local computer.
Чесноков
When uploading a file to server try to attach a GuId with the filename so that we can avoid file duplication problems. :)
Arun Jacob http://codepronet.blogspot.com/
-
Using UploadFile control to upload file to the server fails, if I upload twice the file with the same name with exception that path is not accessible coming from either UploadFile control or from File.Delete if I'm trying to remove it before uploading it again. 1) Clicking [browse] button, selecting the file, uploading it with say UploadFile.Save("path\file.txt"), and do some processing on the file. 2) Clicking [browse] button, selecting the same file, I try to upload the same file.txt to exactly the same location on the server UploadFile.Save("path\file.txt"). And the exception is returned. I do not have such problems on my local computer.
Чесноков
Why don't you do a check to see if the file already exist? You need to work with
File.Exist()
method.Navaneeth How to use google | Ask smart questions