Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Uploading the file to the same path on the server.

Uploading the file to the same path on the server.

Scheduled Pinned Locked Moved ASP.NET
sysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chesnokov Yuriy
    wrote on last edited by
    #1

    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.

    Чесноков

    E A N 3 Replies Last reply
    0
    • C Chesnokov Yuriy

      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.

      Чесноков

      E Offline
      E Offline
      Elayaraja Sambasivam
      wrote on last edited by
      #2

      Always add the exception message in your questions..

      1 Reply Last reply
      0
      • C Chesnokov Yuriy

        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.

        Чесноков

        A Offline
        A Offline
        Arun Jacob
        wrote on last edited by
        #3

        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/

        1 Reply Last reply
        0
        • C Chesnokov Yuriy

          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.

          Чесноков

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups