Hi! Everyone
I need to stream a file to get the information stored in it
my code is as under
FileStream siteFileStream=null;
XmlTextReader XmlRdr=null;
string fileName=http://online.abc.com/ServerDetails.xml;
//string fileName="C:/Documents and
Settings/Administrator/Desktop/aGOnlineServerDetails.xml",FileMode.Open";
siteFileStream = new
eName",FileMode.Open); --> This Line gives an exception
"System.ArgumentException: URI formats are not supported.\r\n at
System.IO.Path.GetFullPathInternal(String path)\r\n at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy)\r\n at System.IO.FileStream..ctor(String path, FileMode
mode)\r\n at line 1287"
If I replace the http: path with the local file path it works perfectly
How can i stream this file if it is on the web. I can perfectly access this
file if i type the same path in ie.
Kindly help this is very very urgent
Regards
Abhishek 6 1828
Hi,
You can use System.Net.HttpWebRequest and System.Net.HttpWebResponse to
issue an HTTP request to a Web resource and to obtain the response stream.
--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today! http://www.x-unity.net/teststudio.aspx
"Abhishek" <ab******@alwayshelpful.com> wrote in message
news:eI**************@TK2MSFTNGP11.phx.gbl... Hi! Everyone
I need to stream a file to get the information stored in it my code is as under
FileStream siteFileStream=null;
XmlTextReader XmlRdr=null;
string fileName=http://online.abc.com/ServerDetails.xml;
//string fileName="C:/Documents and Settings/Administrator/Desktop/aGOnlineServerDetails.xml",FileMode.Open";
siteFileStream = new eName",FileMode.Open); --> This Line gives an exception "System.ArgumentException: URI formats are not supported.\r\n at System.IO.Path.GetFullPathInternal(String path)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)\r\n at System.IO.FileStream..ctor(String path, FileMode mode)\r\n at line 1287"
If I replace the http: path with the local file path it works perfectly
How can i stream this file if it is on the web. I can perfectly access this file if i type the same path in ie.
Kindly help this is very very urgent
Regards Abhishek
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl... Hi,
You can use System.Net.HttpWebRequest and System.Net.HttpWebResponse to issue an HTTP request to a Web resource and to obtain the response stream.
actually this does not work properly since it slows down the process
considerably.
how about being nice and telling what you did?
"Abhishek" <ab******@alwayshelpful.com> wrote in message
news:uv**************@tk2msftngp13.phx.gbl... Thnx I have solved it.
"Ashish Das" <yh****@hotmail.com> wrote in message
news:eb**************@TK2MSFTNGP10.phx.gbl... how about being nice and telling what you did?
Sure i'll be glad to share it.
Actually i dropped the Filestream object and just put the path directly in
the XMLReader class.
Bingo that worked.
Probably FileStream class works only with local files.
Cheers!
Abhishek
Abhishek wrote:
"Ashish Das" <yh****@hotmail.com> wrote in message news:eb**************@TK2MSFTNGP10.phx.gbl... how about being nice and telling what you did?
Sure i'll be glad to share it. Actually i dropped the Filestream object and just put the path directly in the XMLReader class. Bingo that worked.
Which is just a neat shortcut for downloading the file via HTTP (see
Dmitriy's post).
Cheers,
-- http://www.joergjooss.de
mailto:ne********@joergjooss.de This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Markus Ernst |
last post by:
Hi
I know this question is rather HTTP related than PHP, but I did not find an
HTTP group on my news server.
I deliver some files with the following PHP syntax:
header('Content-Description:...
|
by: googlegroups |
last post by:
I am playing with the XMLHTTPRequest method to perform client/server
transactions. I have it set up right now so that when readyState is 4,
it takes the XML and processes it. This works great until...
|
by: A.M-SG |
last post by:
Hi,
I have a ASP.NET aspx file that needs to pass large images from a network
storage to client browser. The requirement is that users cannot have access
to the network share. The aspx file...
|
by: |
last post by:
Hi all, is there a better way to stream binary data stored in a table in sql
2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We
noticed that in certain heavy load scenarios,...
|
by: Amjad |
last post by:
Hi i am writing a application where i want to browse video file and copy data
into stream and send that stream over network...I have develop P2P windows
application where i successfully transfer...
|
by: michael |
last post by:
Hello all,
I have a Linksys WVC54GC network camera that I am trying
to integrate into a website and to enable browsers
other than IE to use.
Linksys, in their ever-short-sighted ways, decided...
|
by: SPG |
last post by:
Hi,
Two questions for you all..
Firstly, is there a way of streaming video using PHP? At the moment I just
have a link to a video file and the whole thing downloads before playing
which is a...
|
by: donnyf |
last post by:
Hi guys. I've put together a website ( http://worldwidemediaproject.com
) that is a database of internet streaming tv/radio stations from
around the world. I have built the site with all users in...
|
by: Brad |
last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and
response.binarywrite to send content to the browser. This has worked great for years...
|
by: Faisal Shafiq |
last post by:
I want to upload a file direct to the Silverlight Streaming Service from a
Web Client such as silverlight application.
As per our product requirement we want to upload a .WMV file directly from...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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: 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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |