473,396 Members | 1,756 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,396 software developers and data experts.

Problem in Reading .eml file from ExchangeWebLocation using HTTPWebRequest

I am using the HTTPWebRequest's GET method to retrieve file from a
ExchangeServer web location like
"http://server/public/Mine/Minemail.EML". I am using following code for
this

string strFolderURI = "http://Daffoserver/public/Mine/Mast.EML";
request = (HttpWebRequest)HttpWebRequest.Create(strFolderURI );
request.Credentials = myCredentialCache;
request.Method = "GET";
response = request.GetResponse();
Stream requestStream = response.GetResponseStream();
BufferedStream requestBufferedStream = new
BufferedStream(requestStream);
System.IO.FileStream fileStream =
System.IO.File.Open(@"c:\MineMail.eml",
System.IO.FileMode.OpenOrCreate);
BufferedStream fileBufferedStream = new BufferedStream(fileStream);
int readByte;
while ((readByte = requestBufferedStream.ReadByte()) != -1)
{
fileBufferedStream.WriteByte((Byte)readByte);
}

requestBufferedStream.Close();
fileBufferedStream.Close();
response.Close();

But file getting using this is not in proper format. In my view as
response is in HTML format so file is not being created correctly. But
if i am using the same code for .chm,.jpg,.doc,.txt like files then its
copying file correctly. I am not able to understand what is difference
in case of .eml files.

Please help me its urgent. If i am doing something wrong ?

Best Regards
Parveen Beniwal

Aug 4 '06 #1
0 1326

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

Similar topics

4
by: Serban | last post by:
Hi I have two applications(client and server) that pass an XML document but I have a hard time reading the XML document on the server side. So the client application creates the XML document...
6
by: Hans Kamp | last post by:
Is it possible to write a function like the following: string ReadURL(string URL) { .... } The purpose is that it reads the URL (determined by the parameter) and returns the string in which...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
5
by: John Lee | last post by:
Hi, I have a simple web page that allow file to be uploaded, the upload page looks like the following: <form method="post" name="upload" enctype="multipart/form-data"...
1
by: Joe Ehrenfeld via .NET 247 | last post by:
I ma having an issue saving a text file that is located on a remove server (Chase Bank) to one of my servers. I know that I have the file in the Srtream object but I just can't seem to get it to save...
4
by: PiotrKolodziej | last post by:
hi I have a thread that downloades a file. Problem is : Not all files are beeing downloaded. I observed that only the small files are beeing downloaded correctly. I also cant download two files...
13
by: Chet C | last post by:
I am trying to make a simple RSS reader using asp.net (VB) and am getting an error when I run the project locally (works fine after being published) Here is my basic code: Sub Page_Load(sender...
0
by: Iridium | last post by:
Greetings, I am trying to get a JPG Frame from a MJPG Stream. A MJPG is basically a stream of JPGs which are splitted by a special boundary string. So I tried to get the stream, split it by the...
1
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.