mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge pull request #135 from ONLYOFFICE/feature/fix-filename
Feature/fix filename
This commit is contained in:
@ -321,7 +321,7 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
_fileName = Path.GetFileName(context.Request["filename"]);
|
||||
|
||||
var extension = (Path.GetExtension(_fileName) ?? "").Trim('.');
|
||||
var extension = (Path.GetExtension(_fileName).ToLower() ?? "").Trim('.');
|
||||
var internalExtension = FileType.GetInternalExtension(_fileName).Trim('.');
|
||||
|
||||
if (ConvertExts.Contains("." + extension)
|
||||
@ -383,7 +383,7 @@ namespace OnlineEditorsExample
|
||||
public static string GetCorrectName(string fileName, string userAddress = null)
|
||||
{
|
||||
var baseName = Path.GetFileNameWithoutExtension(fileName);
|
||||
var ext = Path.GetExtension(fileName);
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
var name = baseName + ext;
|
||||
|
||||
for (var i = 1; File.Exists(StoragePath(name, userAddress)); i++)
|
||||
|
||||
@ -100,7 +100,7 @@ namespace OnlineEditorsExample
|
||||
Response.Redirect("doceditor.aspx?fileID=" + HttpUtility.UrlEncode(FileName));
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(FileName);
|
||||
var ext = Path.GetExtension(FileName).ToLower();
|
||||
|
||||
var editorsMode = Request.GetOrDefault("editorsMode", "edit");
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ namespace ASC.Api.DocumentConverter
|
||||
{
|
||||
convertedDocumentUri = string.Empty;
|
||||
|
||||
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri) : fromExtension;
|
||||
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri).ToLower() : fromExtension;
|
||||
|
||||
var title = Path.GetFileName(documentUri);
|
||||
title = string.IsNullOrEmpty(title) ? Guid.NewGuid().ToString() : title;
|
||||
|
||||
@ -88,8 +88,8 @@ namespace OnlineEditorsExample
|
||||
public static int processSave(Dictionary<string, object> fileData, string fileName, string userAddress)
|
||||
{
|
||||
var downloadUri = (string)fileData["url"];
|
||||
var curExt = Path.GetExtension(fileName);
|
||||
var downloadExt = Path.GetExtension(downloadUri) ?? "";
|
||||
var curExt = Path.GetExtension(fileName).ToLower();
|
||||
var downloadExt = Path.GetExtension(downloadUri).ToLower() ?? "";
|
||||
var newFileName = fileName;
|
||||
|
||||
if (!downloadExt.Equals(curExt, StringComparison.InvariantCultureIgnoreCase))
|
||||
@ -158,8 +158,8 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
var downloadUri = (string)fileData["url"];
|
||||
|
||||
string curExt = Path.GetExtension(fileName);
|
||||
string downloadExt = Path.GetExtension(downloadUri);
|
||||
string curExt = Path.GetExtension(fileName).ToLower();
|
||||
string downloadExt = Path.GetExtension(downloadUri).ToLower();
|
||||
Boolean newFileName = false;
|
||||
|
||||
if (!curExt.Equals(downloadExt))
|
||||
|
||||
Reference in New Issue
Block a user