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

Streaming a dynamically created xml file (using memorystream) to let the client application pick it up automatically...

P: n/a
Guys,

I have a client tool which runs and accepts files with "amt"
extensions. All the "amt" files have been setup to open using my
client tool which works great when I double-click on the file in the
windows explorer.

The way I'm creating the file is completely dynamic depending on the
user's options. Once this memory stream has been created, I'm
rendering on the screen.

This is where the problem is: The user sees the usual dialog which
says,

===========================================
'Some files can harm your computer, If the file information below
looks suspicious, or you do not fully trust the source, do not open or
save this file.

Filename: commands.amt

File Type: XYZ Company's Document Handler

From: localhost

Would you like to open the file or save it to your computer?'

[OPEN] [SAVE] [CANCEL]
[More Info]
=============================================

This is the problem. I don't want to let the user click 'Open' every
time this happens and this happens quite a number of times in a day.

QUESTION:
----------------
How can I let my client tool pickup my "amt" file automatically
without the user having to click 'Open' every time?

I'm also including the different solutions I tried.

-=================================BEGIN============ ==================
public void StreamMemoryStreamToClient(MemoryStream ms)
{
if (ms == null)
return;

//myPage.Response.ClearHeaders();
//myPage.Response.ContentType = "application/amt";
myPage.Response.Clear();
//myPage.Response.OutputStream.Write(ms.GetBuffer(), 0,
ms.GetBuffer().Length);
myPage.Response.AddHeader("content-disposition",
"attachment; filename=commands.amt");
myPage.Response.BinaryWrite(ms.GetBuffer());
//string newWindowScript = "<script language=JavaScript"
+ script + " </script>";
myPage.Response.End();
}
-=================================END============== ================

Environment: ASP.NET 2.0, windows client tool, IIS 5.0, Windows 2000.

Thanks for the help!

SuperKhool

May 29 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It sounds like the client's "Confirm open after download" setting
against the file type in the registry; try editing this manually
(Tools->Options->File Types in explorer, find yours, Advanced). You
may need to deploy a change to the EditFlags setting?

Marc

May 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.