Browse Source

Update AttachmentController.class.php

star7th 4 years ago
parent
commit
7dba44bcb8
1 changed files with 4 additions and 3 deletions
  1. 4 3
      server/Application/Api/Controller/AttachmentController.class.php

+ 4 - 3
server/Application/Api/Controller/AttachmentController.class.php

@@ -45,9 +45,10 @@ class AttachmentController extends BaseController {
 
         $array = explode("/Public/Uploads/", $url) ;
         $file_path = "../Public/Uploads/".$array[1] ;
-		if (file_exists($file_path) && $ret['display_name']) {
-            $this->_downloadFile($file_path, $ret['display_name']);
-		}else{
+	$oss_open = D("Options")->get("oss_open" ) ;
+	if (!$oss_open && file_exists($file_path) && $ret['display_name']) {
+    	    $this->_downloadFile($file_path, $ret['display_name']);
+	}else{
             header("location:{$url}");
         }