473,466 Members | 4,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

create and stream text file on the fly

Hello!

Please, could you tell me, is it possible to create and stream for example a
text file to the browser so that the file is not stored anywhere on a hard
drive?

User click's a link, eg. http://my.domain.com/apps/app/page.aspx?docID=235
and then the text file opens with a text "235" and when the user closes the
file there is not track of the file anywhere on a hard drive.

Your help is very much appreciated!

Thanks.

Peter

Nov 19 '05 #1
3 2617
Jon
Hello Peter,

As an idea, could you not use a cookie or session? What are you trying to do?

Thanks,

Jon

"Peter" wrote:
Hello!

Please, could you tell me, is it possible to create and stream for example a
text file to the browser so that the file is not stored anywhere on a hard
drive?

User click's a link, eg. http://my.domain.com/apps/app/page.aspx?docID=235
and then the text file opens with a text "235" and when the user closes the
file there is not track of the file anywhere on a hard drive.

Your help is very much appreciated!

Thanks.

Peter

Nov 19 '05 #2
Hello John!

Thank you for reply.

We have Documents management system and it's client application installed on
every machine. There is document number property in database which identifies
all documents and can be used to open all documents in user's machine.

I can create a text file with .DRF extention (eg. mydoc.drf) and there is
one row inside this .DRF file and it goes like this:
"DOCUMENTSLIB;DOCUMENTS;123456" where "123456" is a document number. When
user doubleclicks this DRF file, document whith document number 123456 is
opened by DM System's clien app. Now I need to extend this functionality to
the browser. For example I can retrieve all user's documents (documents
number and documents name) which are stored in the system to the DataGrid
contorl and now I need to create this .DRF file on the fly and stream it to
the browser so that DM System's clien application opens it.

Now I have over 500 000 .drf files, created with for loop, stored on a hard
drive and links to those files, but I think this is not very sophisticated
way to resolve the problem.

Peter
"Jon" wrote:
Hello Peter,

As an idea, could you not use a cookie or session? What are you trying to do?

Thanks,

Jon

"Peter" wrote:
Hello!

Please, could you tell me, is it possible to create and stream for example a
text file to the browser so that the file is not stored anywhere on a hard
drive?

User click's a link, eg. http://my.domain.com/apps/app/page.aspx?docID=235
and then the text file opens with a text "235" and when the user closes the
file there is not track of the file anywhere on a hard drive.

Your help is very much appreciated!

Thanks.

Peter

Nov 19 '05 #3
Hi Peter,

If you are sure the file is text file, you can use
following code:

Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "text/plain";
Response.Charset = string.Empty ;
string path = GetFilePath() ; // here you need find out
file path you want to open.
this.Response.WriteFile(path);
this.Response.End();

The question is how do you access the files in client
machine. If you run the application in Intranet, you might
need give ASPNET permission to access those files.

Hope it's helpful.

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello!

Please, could you tell me, is it possible to create and stream for example atext file to the browser so that the file is not stored anywhere on a harddrive?

User click's a link, eg. http://my.domain.com/apps/app/page.aspx?docID=235and then the text file opens with a text "235" and when the user closes thefile there is not track of the file anywhere on a hard drive.
Your help is very much appreciated!

Thanks.

Peter

.

Nov 19 '05 #4

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

Similar topics

4
by: Nicholas Then | last post by:
I am writing an ASP.NET application and I have a class that I have written to create a vCard...it just returns a string with all the necessarry info... Anyway...is there a way that I can create a...
0
by: a | last post by:
Save text file as html kloepper 17:42 23 Jul '04 I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
4
by: FayeC | last post by:
I have tried to use a php code (found it online) to create a gallery but I am wondering if thereare any other PHP options besides using EXIF. The reason is that the images I am using for the...
9
by: anachronic_individual | last post by:
Hi all, Is there a standard library function to insert an array of characters at a particular point in a text stream without overwriting the existing content, such that the following data in...
0
by: r0swell | last post by:
Hey all, I'm trying to make my app read the stream of a text file and begin at the end of the file. Then parse all the lines that get added in the text file by a other app (Its a log file from a...
5
by: Simon Rigby | last post by:
Hi folks, Apologies if this is not directly relevant but I was struggling to find a group with the appropriate context. So as my problem is in an aspx web site I thought I'd try here first....
8
by: paraidy | last post by:
Hi all, as from object i need to read all byte from a file example c: \myphoto.jpg and recreate the file with another name to another directory c:\photo\recreatedphoto.jpg can someone write a...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
5
by: Nitin Mahajan | last post by:
Guys Is there a way in C# to create a word object directly from a memory stream without passing that to hard disk (file stream). I think it doesn't makes sense to create a file just to read it...
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...
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
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.