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. Creating Folder at Server through client.

Creating Folder at Server through client.

Scheduled Pinned Locked Moved ASP.NET
sysadminsales
5 Posts 3 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.
  • B Offline
    B Offline
    Binod K
    wrote on last edited by
    #1

    Hi, In my application i require to create a folder by customername, when any new customer is added. But the folder should be created on the Server not on workstation. if is use following code, where the folder will be created, C Drive of Local Machine or C drive of Web Server. Dim diCust As DirectoryInfo = Directory.CreateDirectory("C:/TestCustomer") I want to create on Server. Please Speak. Thanks

    Binod K. (Miles to go before I sleep)

    I 1 Reply Last reply
    0
    • B Binod K

      Hi, In my application i require to create a folder by customername, when any new customer is added. But the folder should be created on the Server not on workstation. if is use following code, where the folder will be created, C Drive of Local Machine or C drive of Web Server. Dim diCust As DirectoryInfo = Directory.CreateDirectory("C:/TestCustomer") I want to create on Server. Please Speak. Thanks

      Binod K. (Miles to go before I sleep)

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      Binod K. wrote:

      if is use following code, where the folder will be created, C Drive of Local Machine or C drive of Web Server. Dim diCust As DirectoryInfo = Directory.CreateDirectory("C:/TestCustomer")

      If your application is placed on web server and you are running from there then folder will be created there other than if you run your application from local machine then it will be created on local machine drive.:rose:

      please don't forget to vote on the post that helped you.

      B 1 Reply Last reply
      0
      • I Imran Khan Pathan

        Binod K. wrote:

        if is use following code, where the folder will be created, C Drive of Local Machine or C drive of Web Server. Dim diCust As DirectoryInfo = Directory.CreateDirectory("C:/TestCustomer")

        If your application is placed on web server and you are running from there then folder will be created there other than if you run your application from local machine then it will be created on local machine drive.:rose:

        please don't forget to vote on the post that helped you.

        B Offline
        B Offline
        Binod K
        wrote on last edited by
        #3

        thanks for your thought Imran. As its web application, One will run the application through URL from local machine. There is no general point to use application from server. So where the folder will be created ? Does i require to map Server Path. Thanks

        Binod K. (Miles to go before I sleep)

        T 1 Reply Last reply
        0
        • B Binod K

          thanks for your thought Imran. As its web application, One will run the application through URL from local machine. There is no general point to use application from server. So where the folder will be created ? Does i require to map Server Path. Thanks

          Binod K. (Miles to go before I sleep)

          T Offline
          T Offline
          Tamer Oz
          wrote on last edited by
          #4

          In Asp.Net applications folders and files always created at server. If you know the path directly you can write it as c:\..... but if the path will be depended to the directory of application is running you should use Server.MapPath. Using Server mappath is good for any changes of application directory or web server. EX if application is running at c:\inetpub\wwwroot\exapplication Server.MapPath() gives you the result c:\inetpub\wwwroot\exapplication Server.MapPath("Example") gives you the result c:\inetpub\wwwroot\exapplication\Example

          B 1 Reply Last reply
          0
          • T Tamer Oz

            In Asp.Net applications folders and files always created at server. If you know the path directly you can write it as c:\..... but if the path will be depended to the directory of application is running you should use Server.MapPath. Using Server mappath is good for any changes of application directory or web server. EX if application is running at c:\inetpub\wwwroot\exapplication Server.MapPath() gives you the result c:\inetpub\wwwroot\exapplication Server.MapPath("Example") gives you the result c:\inetpub\wwwroot\exapplication\Example

            B Offline
            B Offline
            Binod K
            wrote on last edited by
            #5

            Thanks Tamer, Now i am pretty much clear about it. I hosted my application on IIS, tested using URL from different machine, it creates folder on server machine only. Again thanks for your addition.

            Binod K. (Miles to go before I sleep)

            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