Solved

Content-Type and MS Word

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Alignment is not working correctly. 8 38
paypal ipn url 5 53
MouseOver help for Intranet website 2 22
Porbably easy CSS question about overlapping and offset images 21 26
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…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 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 …

813 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

12 Experts available now in Live!

Get 1:1 Help Now