473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Upload into Word document with images

Hello world,

I have an ASP.NET application that returns HTML to the browser that
should be read by MS Word.
To do this I set Response.ContentType = ContentType.Word and render the
HTML.
The browser (IE6.0) shows a dialog box which enables the user to Open
the HTML in Word or save it to disk.

So far so good.

But now I want to include a number of images into the Word document.
These images are created on the fly during the generation of the HTML
(so they are not available in a file on the webserver).
I know that there is something like

<img src="data:image/gif;base64,iVBORw0KG....." >

to include the image itself in the HTML. This construction is
understood by Firefox, but not by IE or MS Word.

So I think I should upload the images as seperate files. A subdirectory
in de Temporary Internet Files should be created, the images should be
saved in this subdirectory and the HTML should refer to those images,
for example <img src="MyDir\MyImageFile.jgp">.

Does anyone know how to do this or have any other suggestion?

Thanks in advance,
Gerard

Dec 15 '05 #1
2 3160
you need to defer image generation until the image fetch

<img src="generateImage.aspx?id=18282">

where id identifies the parameters need to generate the image.

-- bruce (sqlwork.com)
<ge****************@getronics.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Hello world,

I have an ASP.NET application that returns HTML to the browser that
should be read by MS Word.
To do this I set Response.ContentType = ContentType.Word and render the
HTML.
The browser (IE6.0) shows a dialog box which enables the user to Open
the HTML in Word or save it to disk.

So far so good.

But now I want to include a number of images into the Word document.
These images are created on the fly during the generation of the HTML
(so they are not available in a file on the webserver).
I know that there is something like

<img src="data:image/gif;base64,iVBORw0KG....." >

to include the image itself in the HTML. This construction is
understood by Firefox, but not by IE or MS Word.

So I think I should upload the images as seperate files. A subdirectory
in de Temporary Internet Files should be created, the images should be
saved in this subdirectory and the HTML should refer to those images,
for example <img src="MyDir\MyImageFile.jgp">.

Does anyone know how to do this or have any other suggestion?

Thanks in advance,
Gerard

Dec 15 '05 #2
Bruce,

Thanks for reaction. I'm glad you were not mislead by the word
"Upload".
Of course it should have been "Download".

I'm afraid you're proposed solution has one disadvantage: if the user
saves the Word-document and wants to review it when offline,
he won't see the images anymore.

Do you think there is solution that doesn't have this disadvantage, or
am I looking for something that is just impossible?

Gerard

Dec 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Philippe Lemmerling | last post by:
I have a question concerning security of my file upload script. I'm using the php upload routines (move_uploaded_file,...) and variables ($_FILES) to upload images to a webdirectory. Everything...
1
by: Roger Withnell | last post by:
I would like a site administrator to be able to upload documents to be displayed in the body of web pages. Please advise what choices I have. I would like the Administrator to be able to use...
4
by: miarte | last post by:
I have a form to allow the user upload images. The user browse for an image in their computer and click open, th image to be upload is preview on the img tag. The script works fine with IE, but...
2
by: msdev | last post by:
As all my users are intranet-based and have the Office package installed. I have decided to stream a server-stored document into a web browser, so that the user can use Microsoft Word to modify...
6
by: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes | last post by:
I have a strange problem when uploading a PDF document to a web-server. When I try this to a web-server running Apache 2 on a FC 4, it fails. Firefox says that the document contain no data. If I...
9
by: Steve Poe | last post by:
I work for an animal hospital trying to use PHP to store an animal's dental x-rays to a file server. I can browse for the xray on the local desktop computer then click "Upload Image". This...
3
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need ...
1
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need ...
1
by: =?Utf-8?B?UmFqYWdvcGFs?= | last post by:
Question How to Upload multiple images in asp.net? (ex.Like a gmail file field)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.