473,405 Members | 2,154 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,405 software developers and data experts.

generate xml file and allow user to download it...

I want to generate an XML file on the server side and allow the user to
download it by clicking on a link. I also want the XML file to always be
named "Config.XML"

Whats the best way to do this?

If I create an ASP.NET page called Config.aspx, I can generate the XML file
(and change the mime type). However, when the user tries to save it on his
desktop, IE names it Config.aspx instead of Config.xml.

Is there a clean simple way to generate the XML on the server side and give
it to the user as a download link that he can just save? Maybe I need to
save a temp file on the server side and give that to the user as a download
link. But then how do I handle multiple users who all need a Config.xml
file?

Thanks!!

Oct 13 '06 #1
1 3293
You can set the filename by providing a "content-disposition" HTTP
header, e.g.

Response.ContentType = "text/xml";
Response.AppendHeader("content-disposition",
"attachment;filename=Config.xml");
Response.Write(myXmlDoc.DocumentElement.OuterXml);
Response.End();

John Q. Adams wrote:
I want to generate an XML file on the server side and allow the user to
download it by clicking on a link. I also want the XML file to always be
named "Config.XML"

Whats the best way to do this?

If I create an ASP.NET page called Config.aspx, I can generate the XML file
(and change the mime type). However, when the user tries to save it on his
desktop, IE names it Config.aspx instead of Config.xml.

Is there a clean simple way to generate the XML on the server side and give
it to the user as a download link that he can just save? Maybe I need to
save a temp file on the server side and give that to the user as a download
link. But then how do I handle multiple users who all need a Config.xml
file?

Thanks!!
Oct 13 '06 #2

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

Similar topics

5
by: | last post by:
I am having a major problem with file transfers - they are ending early when the bandwidth tops-out. Smaller files transfer just fine, but large files (12Mb+) can 'abort' the transfer after maybe...
4
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a...
2
by: John Spiegel | last post by:
Hi all, How does one allow a user to download a file WITH selecting where it should be downloaded to on their machine? Also, when using the WebClient.Download method, will the destination path...
3
by: Paul | last post by:
I need a way of creating a custom file which can be downloaded by a user. The file needs to be customized pre user (ie serial number built in). Creating the file is no problem. The problem is how...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
3
by: ccole | last post by:
I have about thirteen configuration files that are written in XML. I need to be able to read and cross reference these files with each other. I have already written an xsl translator but due to...
3
by: jerryyang_la1 | last post by:
I'm looking for a script / scripts that will allow me to control files that users can download. I would like to create 'General Folder' that any registered user can download from and private...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
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...

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.