EPi サーバー プロバイダーを使用しています。
<add virtualPath="~/WorkplaceFiles/" physicalPath="C:\Temp Files\Workplaces"
name="workplaceFiles" type="EPiServer.Web.Hosting.VirtualPathNativeProvider,EPiServer"
showInFileManager="true" virtualName="workplaceUploadDocuments" bypassAccessCheck="true" maxVersions="5" />
プロバイダーの定義は次のとおりです。
VirtualPathUnifiedProvider provider =
VirtualPathHandler.GetProvider(DocumentConstants.WorkplaceFiles) as VirtualPathUnifiedProvider;
そして、ここに私の問題があります-たとえば、次のように文字列を定義すると:
string path = "2999/Documents/document.txt"
path = String.Concat(provider.VirtualPathRoot, path);
FileInfo file = new FileInfo(path);
FileInfo
physicalPath ではなく virtualPath を使用しているため、このファイルを見つけることができません。
でファイルを見つけることができるように、physicalPath を取得するにはどうすればよいFileInfo
ですか?
// When I'm on this line I would like my path string to be "C:\Temp Files\Workplaces\2999\Documents\document.txt"
FileInfo file = new FileInfo(path);