Allow WS to save outside web directory
-
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
-
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
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
-
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
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
-
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
Can you not just grant whatever user context the web service is running the rights to the folder where you want to save them?
-
Can you not just grant whatever user context the web service is running the rights to the folder where you want to save them?
-
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
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?