If you are 100% sure that your file is below your physical application root, you can just do the following:
virtualFilePath = physicalFilePath.Replace (HttpRuntime.AppDomainAppPath, "/").Replace (Path.DirectorySeparatorChar, '/');
virtualFilePath = physicalFilePath.Replace (HttpRuntime.AppDomainAppPath, "/").Replace (Path.DirectorySeparatorChar, '/');
No comments:
Post a Comment