Folder/file Access Denied...

WellsCarrie

Well-known member
Joined
Jul 12, 2005
Messages
95
Location
Arkansas
Programming Experience
5-10
Ok, here's the situation... my company will be implementing a new manufacturing system/solution in December. It will be producing 10 to 20 fixed length data files an hour that will have to be read by the Shipping departments AS400.

So that the AS400 team can start testing thier file conversion app, I have been asked to supply the team with a web application that lets them choose one of the CURRENT manufacturing files and convert it to the new format that the NEW manufacturing files will arive in starting January 1, 2006. It Must be a web app since the AS400 team is split across our lovley nation... including 6 displace by Katrina.

No I've taken files of all sorts and writen XML documents, stored their info into oracle ans SQL databases and just FTPed them to secure locations for other processes to pick up. IN ALL this time I've never gotten this error:

"Access to the path "C:\Inetpub\wwwroot\TestFileConverter\Files\shptowin.txt" is denied."

I get this when I try to "file.postedfile.saveAs" with file being the contents of the System.Web.UI.HtmlControls.HtmlInputFile the user has.

Now I have given Machine\ASPNET FullControl of the "Files" folder. It is supposed to be a staging folder in my webapp "TestFileConverter" to store the .txt file they've choosen. I want to save to this folder. open a streamReader to the loaded file and a streamwriter.CreateText to the file I'm going to create. Run my conversion and then close both streams.


HERE'S MY PROBLEM... It works GREAT on my localhost. But I get the error everytime I run from the prod server. I have double and triple checked that permissions are set correctly for machine\aspnet.

Does anyone have any ideas?
 
Hey,

I have no idea why it wouldn't work if the permissions are set. The only thing I see, and I'm clutching at straws here is that the file name looks weird "shptowi n.txt" is that the actual intended filename with a space? Apart from that I haven't a clue.
 
No, that was just a typing mistake... the file name should be what ever file they choose. since it will be AS400 text files there will be no spaces in the file name.

One instresting thing I have discovered is that if I use indentity impersonation (imperanating me)...then everything works fine on the production server.... Now I cann't leave the impersonation that way since password policy requires us to change PW every 15 days.... Also I can't just make aspnet an admin on the prod server.... since I have a good 2 dozen other apps that also user aspnet as thier user.

Still looking for ideas.
 
Back
Top