mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
csharp-mvc: add jwt for download files
This commit is contained in:
@ -254,6 +254,21 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
return createUrl.ToString();
|
||||
}
|
||||
|
||||
public static string GetDownloadUrl(string fileName)
|
||||
{
|
||||
var downloadUrl = new UriBuilder(GetServerUrl(true))
|
||||
{
|
||||
Path =
|
||||
HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "webeditor.ashx",
|
||||
Query = "type=download"
|
||||
+ "&fileName=" + HttpUtility.UrlEncode(fileName)
|
||||
+ "&userAddress=" + HttpUtility.UrlEncode(HttpContext.Current.Request.UserHostAddress)
|
||||
};
|
||||
return downloadUrl.ToString();
|
||||
}
|
||||
|
||||
public static string GetInternalExtension(FileUtility.FileType fileType)
|
||||
{
|
||||
switch (fileType)
|
||||
|
||||
Reference in New Issue
Block a user