파일 시스템에서 가져온 일부 이미지와 프로젝트 이미지 폴더에있는 이미지가있는 템플릿이 있습니다.이미지가 .doc 파일로 렌더링되지 않음
내 grails 애플리케이션의 images 폴더에서 가져온 템플릿의 이미지는 doc 파일에 완벽하게 표시됩니다.
<img src="${g.resource(dir: 'images', file: 'phone-1.gif', absolute: true)}"/>
하지만 파일 시스템 (/ 옵션/profileImages 폴더)에서 오는 이미지가 : 나는 이러한 이미지를 렌더링하는 코드 아래 사용하고 있습니다. 코드 아래 사용하면 템플릿 이미지를 렌더링 :
보기 :
<g:img uri="${g.createLink(controller: 'personalDetail', action: 'showUserProfileImage', absolute: true)}"/>
컨트롤러 :
def showUserProfileImage() {
User user = springSecurityService.currentUser as User
String profilePicturePath = "${grailsApplication.config.profilePictureDirectoryPath}/${user?.profilePicture?.fileName}"
File file = new File(profilePicturePath)
def img = file.bytes
response.contentType = user?.profilePicture?.mimeType
response.outputStream << img
response.outputStream.flush()
}
브라우저에서 이것은 작업을 잘 보여주는 프로필 이미지뿐만 아니라, Grails 렌더링 플러그인을 사용하여 다운로드 한 PDF에서.
문제는 .doc 형식 파일입니다. 문서를 doc 형식으로 다운로드하면 이미지가 표시되지 않습니다.
스크린 샷 : 내가 잘못 곳
누군가가 말해 주시겠습니까?
또는 다른 방법이 있습니까?