Solved

Content-Type and MS Word

Posted on 1998-02-06
4
1,360 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 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now