Solved

Content-Type and MS Word

Posted on 1998-02-06
4
1,376 Views
Last Modified: 2008-02-26
Hi!
I am currently developing a VB program that produces
HTML code. I works just fine but now I have come to
a problem. I want my program to send a word-document
to the user. And I am changing the content-type to:
Content-Type: application/msword

It works, my browser is spawning word as the viewer
but my document attached with VB-code is not in the
correct format, hence I get unreadable text.

Of course the problem could be in my VB-conversion,
but I dont think so.

So my question is:
What is the correct format for sending, in my case,
a word-document. What more than just changing the Content-type tag do I need to do?

Appreciate a quick answer!

                     Best of rgds // Anders Karlsson
0
Comment
Question by:Kalle 2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1842921
as far as I can tell it _is_ a conversion problem. As Office is spawned, the browser correctly identifies the type of document and handles it in the appropriate way, so this seems to work.
Try, instead of launching the word, saving the document to disk (if you don't have this options, look for it under Options/Helper Applications or something like that) and then opening it. Tell me if the document still is unreadable (I think this will be the case)
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1842922
Do you have a URL where you can demonstrate the problem?
0
 
LVL 5

Accepted Solution

by:
icd earned 200 total points
ID: 1842923
I am 90% certain that the problem is that you are not using binary mode to transmit the word document.

So, for example, if you read a word document on your server and 'print' it to stdout in order to transmit it to the client, you should do it something like this (in perl):-

open (FH, "../yourpath/yourdoc.doc");
binmode FH;
while (<FH>) {
print;
}
close FH;

I am not sure of the method in VB but you should have an equivalent to binmode.

0
 

Author Comment

by:Kalle 2
ID: 1842924
It worked out allright.
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question