473,378 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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
1 1793
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael | last post by:
Hello, I'm looking for a way to allow a client who clicks on a link the ability to "adodb.stream" a multimedia file (mainly audio/wav) files, but the file they would be accessing is outside the...
0
by: Phil | last post by:
Hi I have an issue when trying to stream blob image data from a SQL table to a .aspx page. the code I have works for GIF and JPEG but the images can be multiple pages and we would like them to open...
1
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy...
7
by: redraven | last post by:
Hi, I have a webservice with a method that returns an instance of System.IO.MemoryStream. For example: public MemoryStream myMeth() { return new MemoryStream();
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
8
by: Tony K | last post by:
Is streaming audio capable in asp.net 2.0 / AJAX? What I mean by streaming audio is: ability to play one or more songs back to back...or maybe even let the user select several songs to play and it...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am using dotnet remoting with a binarry formatter. I have a property that returns a memorystream that has had a file loaded into it. When I try to access this property though I get an...
3
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.