Solved

Content-Type and MS Word

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

919 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

24 Experts available now in Live!

Get 1:1 Help Now