mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
php: replace download url
This commit is contained in:
@ -177,7 +177,7 @@
|
||||
echo ' <a class="stored-edit '.$storeFile->documentType.'" href="doceditor.php?fileID='.urlencode($storeFile->name).'&user='.$user.'" target="_blank">';
|
||||
echo ' <span title="'.$storeFile->name.'">'.$storeFile->name.'</span>';
|
||||
echo ' </a>';
|
||||
echo ' <a href="webeditor-ajax.php?type=download&filename='.$storeFile->name.'">';
|
||||
echo ' <a href="'.FileUri($storeFile->name).'">';
|
||||
echo ' <img class="icon-download" src="css/images/download-24.png" alt="Download" title="Download" /></a>';
|
||||
echo ' </a>';
|
||||
echo ' <a class="delete-file" data="'.$storeFile->name.'">';
|
||||
|
||||
@ -61,9 +61,6 @@ if (isset($_GET["type"]) && !empty($_GET["type"])) { //Checks if type value exis
|
||||
$response_array = upload();
|
||||
$response_array['status'] = isset($response_array['error']) ? 'error' : 'success';
|
||||
die (json_encode($response_array));
|
||||
case "download":
|
||||
download();
|
||||
exit;
|
||||
case "convert":
|
||||
$response_array = convert();
|
||||
$response_array['status'] = 'success';
|
||||
@ -128,21 +125,6 @@ function upload() {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function download() {
|
||||
$fileName = $_GET["filename"];
|
||||
|
||||
$filePath = getStoragePath($fileName);
|
||||
if (!file_exists($filePath)) {
|
||||
http_response_code(404);
|
||||
return;
|
||||
}
|
||||
header("Content-Length: " . filesize($filePath));
|
||||
header("Content-Type: " . mime_content_type($fileName));
|
||||
|
||||
header("Content-Disposition: attachment; filename=\"".basename($filePath)."\"");
|
||||
readfile($filePath);
|
||||
}
|
||||
|
||||
function track() {
|
||||
sendlog("Track START", "webedior-ajax.log");
|
||||
sendlog("_GET params: " . serialize( $_GET ), "webedior-ajax.log");
|
||||
|
||||
Reference in New Issue
Block a user