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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Access Error to the folder where uploaded file is saved

Access Error to the folder where uploaded file is saved

Scheduled Pinned Locked Moved ASP.NET
sysadmindatabasewindows-admintestingbeta-testing
6 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.
  • K Offline
    K Offline
    K Safvi
    wrote on last edited by
    #1

    Hi, I am importing data to sqlserver2005 from a csv file. But the folder where i upload the file before import is unaccessible even though i have given full rights to everyone accessing this folder or even the root folder of the application for testing purposes. I am getting error 'invalid File' (though the file is valid csv) on my system where Norton and Kaspersky are installed but when i tryed to import data from same file using other system it did not give error and file was uploaded successfully and then imported to database. I have restarted the deployment server. Should i restart iis admin servies or what should i do. I have given full rights on the folder where i m uploading the file before importing it to database. Thanks, Safvi

    G A 2 Replies Last reply
    0
    • K K Safvi

      Hi, I am importing data to sqlserver2005 from a csv file. But the folder where i upload the file before import is unaccessible even though i have given full rights to everyone accessing this folder or even the root folder of the application for testing purposes. I am getting error 'invalid File' (though the file is valid csv) on my system where Norton and Kaspersky are installed but when i tryed to import data from same file using other system it did not give error and file was uploaded successfully and then imported to database. I have restarted the deployment server. Should i restart iis admin servies or what should i do. I have given full rights on the folder where i m uploading the file before importing it to database. Thanks, Safvi

      G Offline
      G Offline
      Gamzun
      wrote on last edited by
      #2

      have you selected the option in advance to implement those permission on child object?

      K 1 Reply Last reply
      0
      • K K Safvi

        Hi, I am importing data to sqlserver2005 from a csv file. But the folder where i upload the file before import is unaccessible even though i have given full rights to everyone accessing this folder or even the root folder of the application for testing purposes. I am getting error 'invalid File' (though the file is valid csv) on my system where Norton and Kaspersky are installed but when i tryed to import data from same file using other system it did not give error and file was uploaded successfully and then imported to database. I have restarted the deployment server. Should i restart iis admin servies or what should i do. I have given full rights on the folder where i m uploading the file before importing it to database. Thanks, Safvi

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        If you try to cut - > paste the file manually from the folder to another, does it allow you to do so? If not, I think IIS must have held the file while uploading. Just restart the IIS Service from IIS console and see if it cures the problem or not. :)

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        K 1 Reply Last reply
        0
        • G Gamzun

          have you selected the option in advance to implement those permission on child object?

          K Offline
          K Offline
          K Safvi
          wrote on last edited by
          #4

          The follwing piece of code is working accuratly some time while inaccuratly on other system. Working ok on local system and even on one system after deplyment. Dim intFileNameLength As Integer = InStr(1, StrReverse(strPath), "\") FileName = Mid(strPath, (Len(strPath) - intFileNameLength) + 2) If Right(FileName, 4).ToLower <> ".txt" And Right(FileName, 4).ToLower <> ".csv" Then ErrorControlStep1.ErrorMessage = "Invalid File" ErrorControlStep1.Visible = True Exit Sub Else .... ... End if What could be the reason. May be this <> operator. while the file was csv not any other. Thanks for ur reply. Safvi

          1 Reply Last reply
          0
          • A Abhishek Sur

            If you try to cut - > paste the file manually from the folder to another, does it allow you to do so? If not, I think IIS must have held the file while uploading. Just restart the IIS Service from IIS console and see if it cures the problem or not. :)

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->** Simplify Code Using NDepend
            Basics of Bing Search API using .NET
            Microsoft Bing MAP using Javascript

            K Offline
            K Offline
            K Safvi
            wrote on last edited by
            #5

            The follwing piece of code is working accuratly some time while inaccuratly on other system. Working ok on local system and even on one system after deplyment. Dim intFileNameLength As Integer = InStr(1, StrReverse(strPath), "\") FileName = Mid(strPath, (Len(strPath) - intFileNameLength) + 2) If Right(FileName, 4).ToLower <> ".txt" And Right(FileName, 4).ToLower <> ".csv" Then ErrorControlStep1.ErrorMessage = "Invalid File" ErrorControlStep1.Visible = True Exit Sub Else .... ... End if What could be the reason. May be this <> operator. while the file was csv not any other. Thanks for ur reply. Safvi

            C 1 Reply Last reply
            0
            • K K Safvi

              The follwing piece of code is working accuratly some time while inaccuratly on other system. Working ok on local system and even on one system after deplyment. Dim intFileNameLength As Integer = InStr(1, StrReverse(strPath), "\") FileName = Mid(strPath, (Len(strPath) - intFileNameLength) + 2) If Right(FileName, 4).ToLower <> ".txt" And Right(FileName, 4).ToLower <> ".csv" Then ErrorControlStep1.ErrorMessage = "Invalid File" ErrorControlStep1.Visible = True Exit Sub Else .... ... End if What could be the reason. May be this <> operator. while the file was csv not any other. Thanks for ur reply. Safvi

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              K.Safvi wrote:

              FileName = Mid(strPath, (Len(strPath) - intFileNameLength) + 2)

              Horrible. Check out the Path class ( system.IO.Path ), it has methods to return filenames, file extensions, etc.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              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