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. Allow WS to save outside web directory

Allow WS to save outside web directory

Scheduled Pinned Locked Moved Web Development
sysadminquestion
6 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.
  • P Offline
    P Offline
    picazo
    wrote on last edited by
    #1

    Hi all, I have a web service that accepts requests from users. I would like to be able to save the results of those requests to file on the server, outside the web directory. The results will be generated by the web service, so I don't think there is great risk of saving unwanted files. Has anyone done this before, or can anyone suggest possible solutions to doing this? Thanks a lot,

    ----------------- Genaro

    F P 2 Replies Last reply
    0
    • P picazo

      Hi all, I have a web service that accepts requests from users. I would like to be able to save the results of those requests to file on the server, outside the web directory. The results will be generated by the web service, so I don't think there is great risk of saving unwanted files. Has anyone done this before, or can anyone suggest possible solutions to doing this? Thanks a lot,

      ----------------- Genaro

      F Offline
      F Offline
      Fred_Smith
      wrote on last edited by
      #2

      I had a similar requirement some tiome back... as far as I know (which isn't saying much...) this can't be done (security don't you know, ooh...), but as it was an acceptable solution for me to save the files within another, different web directory I was able to get around this by: a) saving the files to the current one; b) using an FTP class to transfer them to the second directory; c) deleting the originals; Maybe not so elegant, but it did the job... regards F

      P 1 Reply Last reply
      0
      • F Fred_Smith

        I had a similar requirement some tiome back... as far as I know (which isn't saying much...) this can't be done (security don't you know, ooh...), but as it was an acceptable solution for me to save the files within another, different web directory I was able to get around this by: a) saving the files to the current one; b) using an FTP class to transfer them to the second directory; c) deleting the originals; Maybe not so elegant, but it did the job... regards F

        P Offline
        P Offline
        picazo
        wrote on last edited by
        #3

        Hi Fred, thanks a lot for your comments. Everything I've read seems to indicate that it is not possible. One solution that I have come up with (which I don't like) is the following: a) Select a web directory where all the files will be saved b) Prepend the path where the file should be saved as the first line in the file. c) Have a process that polls the directory d) Have the process read the destination path, remove the first line from the file and move the file. While, this works fine, I don't like having the process polling all the time. It would be great if the web service could launch a console app that took care of moving the file and then terminated. However, this results in access problems. Hopefully a better solution will come along soon. Thanks,

        ----------------- Genaro

        1 Reply Last reply
        0
        • P picazo

          Hi all, I have a web service that accepts requests from users. I would like to be able to save the results of those requests to file on the server, outside the web directory. The results will be generated by the web service, so I don't think there is great risk of saving unwanted files. Has anyone done this before, or can anyone suggest possible solutions to doing this? Thanks a lot,

          ----------------- Genaro

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4

          Can you not just grant whatever user context the web service is running the rights to the folder where you want to save them?

          P 1 Reply Last reply
          0
          • P Paddy Boyd

            Can you not just grant whatever user context the web service is running the rights to the folder where you want to save them?

            P Offline
            P Offline
            picazo
            wrote on last edited by
            #5

            Yes, I think you can do that. But I want to be able to save it anywhere (the WS user would specify where to save it).

            ----------------- Genaro

            P 1 Reply Last reply
            0
            • P picazo

              Yes, I think you can do that. But I want to be able to save it anywhere (the WS user would specify where to save it).

              ----------------- Genaro

              P Offline
              P Offline
              Paddy Boyd
              wrote on last edited by
              #6

              Could you then run your web service under the context of a domain user with read/write rights to whatever folders you want to make available?

              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