DNNCommunity / DNN.Repository

DNN.Repository is a rich module used for managing and displaying rich collections of images, files, llinks, etc. on your DNN site. Includes user rating, comments, templating and skinning.
MIT License
8 stars 14 forks source link

Fixed an issue where extra data was appended to end of downloaded file #56

Closed cdg191 closed 9 months ago

cdg191 commented 1 year ago

Fix issue #55 for extra data appended to end of downloaded file

This is the code I've always used for file downloads in ASP.Net. I'm unclear why the original code, which calls a native Response method, misbehaves. I do know this code hasn't failed me to date.

Although I suggest wrapping it in a try/catch, as if the user cancels the download dialog it throws an exception in the module.

Description of PR...

Changes made

PR Template Checklist

Please mark which issue is solved

Close #55

WillStrohl commented 1 year ago

Nice contribution! A quick question, though... Shouldn't the content-type remain in place to help browsers to know how to handle the stream properly?

valadas commented 9 months ago

@WillStrohl content-type is still there but it is using the property instead of the method. This looks good to me. Merging.