I develop a module working with files. Serving the files in the themes using tilde is OK, but this doesn't seem to work in the controller, where I process the files with System.IO.File
methods like Move()
or Delete()
. For now I use absolute paths, but they are not feasible - the module should be used on different machines and still stored in a single repository.
How to find which root should I use for root-relaive paths in each situation? If there's no universal rule, how to find it while managing upload/download/viewing of files? Or is it more complicated?
My files are stored in: (SolutionRoot)/Orchard.Web/Media/Default/_FooBar/
I've tried all the folders as relative roots and it didn't work.