Welcome to WebmasterWorld Guest from 3.227.3.146

Forum Moderators: ocean10000

Message Too Old, No Replies

Permission Problem

     
6:46 pm on Mar 22, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 19, 2004
posts:207
votes: 0


I have a site with a forum that requires user authentication to post. So I have this in my web.config file:
<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"/>
</authentication>

A user login form looks in a database for name and password. Works fine.

I also have an admin form that instantiates an object from a button click on a form to go retrieve files from a remote server. It works fine and does not require authentication.

My code also spawns a separate thread that instantiates an object from the same class, but it does not get write permission to save the the files in the application root. It's on a shared host.

Is there any way I can use windows authentication for the separate thread object and forms authentication for the users on the same site? Thanks for any help
ray

3:45 am on Apr 21, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 19, 2004
posts:207
votes: 0


Well, here is what I finally did to make it work:

I tried putting all the files involved in fetching the files from a remote server into a separate directory. I put a web.config file in that folder. It still didn't work.

The web is on a shared host at a host company. The aspnet worker process apparently doesn't get write permission, even to its own root directory. So I could not save the retrieved file there.

The aspnet worker process does, however, have write permission on the server os root\temp directory. At my host it is at c:\winnt\temp.

So, my separate thread now gets the remote file, stores it in the winnt\temp derectory. Then I can read it back into memory with a stream reader for any manipulation I want to do. I strip headers, parse data values, and put the data into my database.

Finally I kill the file in the temp directory. Deleting the file is not good enough. That writes the file name in the recycle bin. I don't want the sysadmin at my host finding traces of strange multiple megabyte files in his temp directory or recycle bin. So I use the KILL function. As far as I know this gets rid of the file.

Conclusion about multiple web.config files. I think you can use separate web.config files that only apply to that directory where they are resident. The reason my separate web.config file didn't fix my problem was because of the write permission being denied.