0

My application needs files outside Deploy folder And I would like to know how to set The Path with Server.MapPath("").

This is not a valid solution for me : var FullTempPath ="C:\inetpub\TempFiles" ;

Example:

  • C:\inetpub\ProjectFolder > Deploy
  • C:\inetpub\TempFiles > Here I would like to go:

I was trying with that code but is not working:

 var ParentServerPath = Server.MapPath("..");

 var PartialTempPath = Path.Combine(@"/TempFiles/", key + ".js");

 var FullTempPath = ParentServerPath + PartialTempPath;

The Objective:

of that is save all JS and CSS files Minimized and Compressed generated on a folder outside my project with write permission, also I would like to know if that's a good idea, and where you're saving all that files.

user1520494
  • 1,134
  • 2
  • 11
  • 27
  • "on a folder outside my project with write permission" - do you mean to say you have control of the server environment in which you can access the target folder? – von v. Apr 09 '13 at 09:30
  • Generally I like to contain all the files for one web app in one directory. It makes it easier to redeploy the app, and helps with version control (simply ignore generated files). I store minified version in a folder named something like `content/css` and `content/js` then I have the sources in folders named `css` and `js` on the root of the project. – AlexanderBrevig Apr 09 '13 at 09:33
  • Hi, von. I have no control of the server enviroment I just have access on folders, Project Folder with no writing permission by the application, and a folder ProjectFolder with Writing permission – user1520494 Apr 09 '13 at 09:35
  • Network admins told me that For security reasons application can't write inside Deploy folder -.-' That's true?? – user1520494 Apr 09 '13 at 09:38
  • So you're telling us that in your layout view you cannot do this: ``? And that you actually have to reference it from that "folder outside your project folder"? – von v. Apr 09 '13 at 09:43
  • Yes I can do this! what i can't do is save on C:\inetpub\ProjectFolder\Content\css\213123123123213.css minimized fields generated on server side – user1520494 Apr 09 '13 at 09:46

0 Answers0