POST an unsaved document

N

neoret

Hello.

I need a helping hand to help me send an unsaved dokument through a
POST call.

I have added functionality to word and want to send a unsaved document
through a POST call. This works fine when I try sending a saved
document - refering to the path and using a filstream like this:

FileStream fileStream = new FileStream(remoteFolder + filename,
FileMode.Open, FileAccess.Read);
byte[] buffer = new byte[fileStream.Length];
fileStream.Read(buffer, 0, (int)buffer.Length);
fileStream.Close();
memStream.Write(buffer, 0, buffer.Length);

One solution could be to tempsave the document - send it - then delete
it from temp... But I don't think this is a "clean" way to do it.

If you have any tips for me I would really apreciate it!
 
J

Jan Kucera

I'm afraid that you don't have an ability to use MemoryStream for example
with Office apps. I posted that question some time ago and no success.
I can imagine quite complex and advanced techniques, but nothing simple and
definitely not .net friendly.

If I'm wrong and somebody knows the solution, please let us know, because
I'm tempsaving too.

As for your code, byte[] System.IO.File.ReadAllBytes(path) could maybe save
your first four rows of code. ;-)
Jan
 
C

Cindy M.

I need a helping hand to help me send an unsaved dokument through a
POST call.
Closest you can get is document.Content.XML in Word 2003. That should
give you everything except a few Document Properties. Other than
that, no chance...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top