apache 와 한글2004 에서의 hwp 다운로드,열기

offree의 이미지

debian sarge 에 패키지로 apache2 를 사용하고 있습니다.

그런데, hwp 를 다운로드 하는 것은 별 이상이 없는데, "열기" 로 열게되면 작동을 하지 않는 것입니다.(아래와 첨부파일 과 같이)

혹시 나 해서 apache2 를 apache 로 바꾸어도 보고 했는데, 같은 현상이 발생합니다.

다운로드가 파일을 직접 연결하는 것이 아니라, 코드상에서 파일을 열어서 뿌려주는 방식입니다.

즉, header 값도 보내주고 하는 것이죠.

//$mime = 'application/octet-stream' ;
$mime = "application/hwp";

$dn_filename = urlencode($F->filename);

header("Content-Type: $mime") ;
header("Content-Length: $B->filesize");
//header("Content-Disposition: attachment; filename=$dn_filename");
header("Content-Disposition: inline; filename=$dn_filename");


같은 형식으로요.

위의 mime 도 바꾸어 보고, attachment , inline 도 바꾸어 보면서 테스트 해 보았는데.
mime 은 별 상관이 없는 것 같고, 우선 inline 이 맞는 것 같긴 합니다.

한글도 다른것은 별 문제 없는데, 한글2004 버전만 유독 그런것 같습니다.
또한 같은 한글2004 라도 윈XP 와 윈2000에서도 또한 다른것 같구요.(IE 버전차이인지..)

내일 다시 테스트를 해보겠지만, 답이 안나오네요. ^^;

혹시 이런 비슷한 현상을 겪어 보신분 계신지요?
(한글2004의 버그로 봐야 하나?)

ps. 프로그래밍 Q&A 로 가야 하나?

File attachments: 
첨부파일 크기
Image icon hwp2004.jpg184.11 KB
ai의 이미지

비슷한 문제가 있어 아래와 같이 서버 응답을 수정해 해결을 했습니다.
파일을 "열기" 했을때 다운로드한 임시파일을 읽도록 강제합니다.

Cache-control: private
Content-type:application/octet-stream
Content-Length: $fsize
Content-Disposition:attachment;filename=\"$fname\"
Content-Transfer-Encoding:binary
Pragma:no-cache
Expires:0

어떤 것이 표준인지, 또 ie 의 버그인지 어떤지는 아직도 모르겠습니다만..
Cache-control, Pragma 두 개가 키포인트였던 것으로 기억합니다.
apache, php, tomcat, mime.types 등 서버 환경으로는 해결이 잘 안되더군요.

--
War doesnt determine whos right, just whos left.

War doesnt determine whos right, just whos left.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.