mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
format
This commit is contained in:
@ -95,9 +95,10 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
}
|
||||
var downloadUri = (string)fileData["url"];
|
||||
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
var downloadExt = fileData.ContainsKey("filetype") ? "."+(string)fileData["filetype"]: Path.GetExtension(downloadUri).ToLower() ?? "";
|
||||
// Support for versions below 7.0
|
||||
|
||||
var downloadExt = fileData.ContainsKey("filetype")
|
||||
? "." + (string)fileData["filetype"]
|
||||
: Path.GetExtension(downloadUri).ToLower() ?? ""; // TODO: Delete in version 7.0 or higher. Support for versions below 7.0
|
||||
|
||||
var newFileName = fileName;
|
||||
|
||||
@ -170,9 +171,10 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
var downloadUri = (string)fileData["url"];
|
||||
|
||||
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
var downloadExt = fileData.ContainsKey("filetype") ? "."+(string)fileData["filetype"]: Path.GetExtension(downloadUri).ToLower();
|
||||
// Support for versions below 7.0
|
||||
|
||||
var downloadExt = fileData.ContainsKey("filetype")
|
||||
? "." + (string)fileData["filetype"]
|
||||
: Path.GetExtension(downloadUri).ToLower(); // TODO: Delete in version 7.0 or higher. Support for versions below 7.0
|
||||
|
||||
Boolean newFileName = false;
|
||||
|
||||
|
||||
@ -95,13 +95,15 @@ namespace OnlineEditorsExample
|
||||
if (fileData["url"].Equals(null)) {
|
||||
throw new Exception("DownloadUrl is null");
|
||||
}
|
||||
var downloadUri = (string)fileData["url"];
|
||||
var downloadUri = (string)fileData["url"];
|
||||
var curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
var downloadExt = fileData.ContainsKey("filetype") ? "."+(string)fileData["filetype"]: Path.GetExtension(downloadUri).ToLower() ?? "";
|
||||
// Support for versions below 7.0
|
||||
|
||||
var downloadExt = fileData.ContainsKey("filetype")
|
||||
? "." + (string)fileData["filetype"]
|
||||
: Path.GetExtension(downloadUri).ToLower() ?? ""; // TODO: Delete in version 7.0 or higher. Support for versions below 7.0
|
||||
|
||||
var newFileName = fileName;
|
||||
|
||||
// convert downloaded file to the file with the current extension if these extensions aren't equal
|
||||
if (!downloadExt.Equals(curExt, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
@ -175,10 +177,12 @@ namespace OnlineEditorsExample
|
||||
throw new Exception("DownloadUrl is null");
|
||||
}
|
||||
var downloadUri = (string)fileData["url"];
|
||||
|
||||
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
var downloadExt = fileData.ContainsKey("filetype") ? "."+(string)fileData["filetype"]: Path.GetExtension(downloadUri).ToLower();
|
||||
// Support for versions below 7.0
|
||||
|
||||
var downloadExt = fileData.ContainsKey("filetype")
|
||||
? "." + (string)fileData["filetype"]
|
||||
: Path.GetExtension(downloadUri).ToLower(); // TODO: Delete in version 7.0 or higher. Support for versions below 7.0
|
||||
|
||||
Boolean newFileName = false;
|
||||
|
||||
|
||||
@ -94,10 +94,10 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
String newFileName = fileName;
|
||||
|
||||
String curExt = fileUtility.getFileExtension(fileName); // get current file extension
|
||||
String downloadExt = "."+body.getFiletype(); // get an extension of the downloaded file
|
||||
String downloadExt = "." + body.getFiletype(); // get an extension of the downloaded file
|
||||
|
||||
// Todo [Delete in version 7.0 or higher]
|
||||
if (downloadExt != "."+null) downloadExt = fileUtility.getFileExtension(downloadUri); // Support for versions below 7.0
|
||||
if (downloadExt != "." + null) downloadExt = fileUtility.getFileExtension(downloadUri); // Support for versions below 7.0
|
||||
|
||||
//TODO: Refactoring
|
||||
if (!curExt.equals(downloadExt)) { // convert downloaded file to the file with the current extension if these extensions aren't equal
|
||||
|
||||
@ -127,10 +127,10 @@ public class TrackManager {
|
||||
String newFileName = fileName;
|
||||
|
||||
String curExt = FileUtility.GetFileExtension(fileName); // get current file extension
|
||||
String downloadExt = "."+(String) body.get("filetype"); // get the extension of the downloaded file
|
||||
String downloadExt = "." + (String) body.get("filetype"); // get the extension of the downloaded file
|
||||
|
||||
// Todo [Delete in version 7.0 or higher]
|
||||
if (downloadExt == "."+null) downloadExt = FileUtility.GetFileExtension(downloadUri); // Support for versions below 7.0
|
||||
if (downloadExt == "." + null) downloadExt = FileUtility.GetFileExtension(downloadUri); // Support for versions below 7.0
|
||||
|
||||
// convert downloaded file to the file with the current extension if these extensions aren't equal
|
||||
if (!curExt.equals(downloadExt)) {
|
||||
|
||||
@ -504,10 +504,10 @@ app.post("/track", function (req, res) { // define a handler for tracking file
|
||||
}
|
||||
|
||||
var curExt = fileUtility.getFileExtension(fileName); // get current file extension
|
||||
var downloadExt = body.document.filetype; // get the extension of the downloaded file
|
||||
var downloadExt = body.document.filetype; // get the extension of the downloaded file
|
||||
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
if (!downloadExt) downloadExt = fileUtility.getFileExtension(downloadUri); // Support for versions below 7.0
|
||||
if (!downloadExt) downloadExt = fileUtility.getFileExtension(downloadUri); // Support for versions below 7.0
|
||||
|
||||
var newFileName = fileName;
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ function processSave($data, $fileName, $userAddress) {
|
||||
$downloadExt = strtolower('.' . $data["filetype"]); // get the extension of the downloaded file
|
||||
|
||||
// TODO [Delete in version 7.0 or higher]
|
||||
if (!$downloadExt) $downloadExt = strtolower('.' . pathinfo($downloadUri, PATHINFO_EXTENSION)); // Support for versions below 7.0
|
||||
if (!$downloadExt) $downloadExt = strtolower('.' . pathinfo($downloadUri, PATHINFO_EXTENSION)); // Support for versions below 7.0
|
||||
|
||||
$newFileName = $fileName;
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ def processSave(body, filename, usAddr):
|
||||
downloadExt = body.get('filetype') # get the extension of the downloaded file
|
||||
|
||||
# Todo [Delete in version 7.0 or higher]
|
||||
if (downloadExt == None):
|
||||
if (downloadExt == None):
|
||||
downloadExt = fileUtils.getFileExt(download) # Support for versions below 7.0
|
||||
|
||||
# convert downloaded file to the file with the current extension if these extensions aren't equal
|
||||
|
||||
Reference in New Issue
Block a user