473,472 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Writing data to a file from ASP.NET?

I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae
Aug 23 '06 #1
6 1094
c:\\ ????

\\ means in a shared folder

when you using " you dont use \\

should be "c:\dumped\aaa.dmp"

dont forget that u need read/write permitions on c:\dumped

--

Bruno Alexandre
"a Portuguese in København, Danmark"

"Hyun-jik Bae" <im***********@paran.comescreveu na mensagem
news:um**************@TK2MSFTNGP02.phx.gbl...
>I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae

Aug 23 '06 #2
Did you ttry using 'Server.MapPath'?

Regards,
Augustin
http://augustinprasanna.blogspot.com

"Hyun-jik Bae" wrote:
I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae
Aug 23 '06 #3
You can use \\ but prefix it with @ symbol as like below,

FileStream writer = new FileStream(@"c:\\dumped\\aaa.dmp", FileMode.Create);

And, check that you have write/read permission for that folder.

Thanks,
--
Vadivel Kumar
http://www.vadivelk.net
va**@online.vadivelk.net (remove "online.")

Hyun-jik Bae wrote:
I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae

Aug 23 '06 #4
Yes @ escape character in c#
Patrick

"Vadivel Kumar" <va******@vadivelk.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
You can use \\ but prefix it with @ symbol as like below,

FileStream writer = new FileStream(@"c:\\dumped\\aaa.dmp",
FileMode.Create);

And, check that you have write/read permission for that folder.

Thanks,
--
Vadivel Kumar
http://www.vadivelk.net
va**@online.vadivelk.net (remove "online.")

Hyun-jik Bae wrote:
>I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae

Aug 23 '06 #5
You can use \\ but prefix it with @ symbol as like below,
>
FileStream writer = new FileStream(@"c:\\dumped\\aaa.dmp",
In fact it's the other way around:

You can do

FileStream writer = new FileStream(@"c:\dumped\aaa.dmp" ...)

or

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp" ...)

It's the '\' that is the escape character, '\\' escapes the '\' so you
end up with only one '\' or using @ says to ignore escaping i.e don't
treat the single '\' as an escape character,

Kevin
Aug 23 '06 #6
Thanks for your answers, Bruno, Augustin, Vadviel, Patrick and Kevin.
I found the cause: whitespaces in filename was the matter. I fixed it by
substituting them to underbar '_'.

"Vadivel Kumar" <va******@vadivelk.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
You can use \\ but prefix it with @ symbol as like below,

FileStream writer = new FileStream(@"c:\\dumped\\aaa.dmp",
FileMode.Create);

And, check that you have write/read permission for that folder.

Thanks,
--
Vadivel Kumar
http://www.vadivelk.net
va**@online.vadivelk.net (remove "online.")

Hyun-jik Bae wrote:
>I wrote an ASP.NET application which receives data from HTTP client and
stores it to a newly created file by my asp.net page.

Everything works ok except for this statement:

FileStream writer = new FileStream("c:\\dumped\\aaa.dmp",
FileMode.Create);

It causes NotSupportedException with "Specified path format is not
supported".

How can I resolve this problem? Please reply. Thanks in advance.

Hyun-jik Bae

Aug 23 '06 #7

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

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
3
by: ishekar | last post by:
Hi, I have an application where i want to write data to a file, the data is being sent from an external source. I know the total size of the data and then i retrieve the data in small segments...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
0
by: Yunus's Group | last post by:
Yunus's Group May 23, 3:36 pm show options Newsgroups: microsoft.public.dotnet.languages.vb From: "Yunus's Group" <yunusasm...@gmail.com> - Find messages by this author Date: 23 May 2005...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
6
by: bonk | last post by:
I am trying to create a stream that writes text to a file and: - automatically creates a new file once the current file exceeds a certain size - makes it possible to be used by multiple threads...
3
by: Barry Flynn | last post by:
Hi I am working with a VB 2005 program which has been converted from VB6. It writes data out to a flat file, with code like the following line WriteLine(riFileNo, "Hist", lsAssetID,...
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
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
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.