Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Content-Type and MS Word

Posted on 1998-02-06
4
Medium Priority
?
1,382 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
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 800 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

971 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