내가 제거해야한다는 것을 이해합니다. Content-Disposition: ...
응답 헤더의 행 그것은 쉽기 때문에 OwnCloud의 PHP 코드를 편집 / 해킹하여 문제를 해결했습니다.
에서 lib/private/response.php
내가 바꾼 파일 setContentDispositionHeader
기능은 다음과 같습니다.
static public function setContentDispositionHeader( $filename, $type = 'attachment' ) {
if (OC_Request::isUserAgent(array(
OC_Request::USER_AGENT_IE,
OC_Request::USER_AGENT_ANDROID_MOBILE_CHROME,
OC_Request::USER_AGENT_FREEBOX
))) {
header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' );
} else {
// cca-hack-id:make-raw-output-property ###
// cca-hack-id:make-raw-output-property ### I needed something like "raw" format of github.com.
// cca-hack-id:make-raw-output-property ###
// cca-hack-id:make-raw-output-property ### Usage with an example:
// cca-hack-id:make-raw-output-property ### 1. share a single file and get a public link (MY_PUBLIC_LINK) for the file.
// cca-hack-id:make-raw-output-property ### 2. get the file's direct url (MY_PUBLIC_LINK&download)
// cca-hack-id:make-raw-output-property ### 3. append '&raw' to the url: MY_PUBLIC_LINK&download&raw
// cca-hack-id:make-raw-output-property ###
// cca-hack-id:make-raw-output-property ### If you want to undo this hack, remove all lines which contains 'cca-hack-id:make-raw-output-property' string.
// cca-hack-id:make-raw-output-property ###
if (!array_key_exists('raw', $_GET)) { // cca-hack-id:make-raw-output-property
header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename )
. '; filename="' . rawurlencode( $filename ) . '"' );
} // cca-hack-id:make-raw-output-property
}
}