By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

create and stream text file on the fly

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.