Changing extension of file output via MIME-type package
Hi Folks,
I'm working on creating a simple csv export using the mime-type package (although i believe this can be done with <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>) and can happily create csv files with the correct formatting and mime-type that prompt yp be saved when the template is visited (and not served as text to the browser).
However, I'd like the file to already have a file extension of my choosing when the download dialogue pops up, instead of just using the aspx extension of the template. Given that we have to cater to the lowest common denominator, it's essential to not require the user to change the file extension of the file as they save it or after they download it.
Does anyone know how this could be accomplished? Preferably without using custom .net usercontrols.
Changing extension of file output via MIME-type package
Hi Folks,
I'm working on creating a simple csv export using the mime-type package (although i believe this can be done with <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>) and can happily create csv files with the correct formatting and mime-type that prompt yp be saved when the template is visited (and not served as text to the browser).
However, I'd like the file to already have a file extension of my choosing when the download dialogue pops up, instead of just using the aspx extension of the template. Given that we have to cater to the lowest common denominator, it's essential to not require the user to change the file extension of the file as they save it or after they download it.
Does anyone know how this could be accomplished? Preferably without using custom .net usercontrols.
Cheers,
Dan
Content-Disposition should be what you are looking for. Try look here http://www.west-wind.com/weblog/posts/76293.aspx
Petr
Thanks Petr, I gave up and asked one of our Devs to create a usercontrol! You get the answer anyway, as it was indeed the right direction to take.
I've packaged up the usercontrol and uploaded it to http://our.umbraco.org/projects/change-output
Dan
is working on a reply...