Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dandrayne 1138 posts 2262 karma points
    Sep 21, 2009 @ 12:18
    dandrayne
    0

    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

  • Petr Snobelt 923 posts 1535 karma points
    Sep 21, 2009 @ 12:51
    Petr Snobelt
    0

    Content-Disposition should be what you are looking for. Try look here http://www.west-wind.com/weblog/posts/76293.aspx

    Petr

  • dandrayne 1138 posts 2262 karma points
    Sep 21, 2009 @ 16:32
    dandrayne
    0

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft