Skip to content

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

Merged
valadas merged 1 commit into
DNNCommunity:developfrom
cdg191:patch-1
Dec 8, 2023
Merged

Fixed an issue where extra data was appended to end of downloaded file#56
valadas merged 1 commit into
DNNCommunity:developfrom
cdg191:patch-1

Conversation

@cdg191

@cdg191 cdg191 commented Jun 9, 2023

Copy link
Copy Markdown
Contributor

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

  • ReWrote StreamFile.

PR Template Checklist

  • Fixes Bug
  • Feature solution
  • Other

Please mark which issue is solved

Close #55

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

Copy link
Copy Markdown
Member

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

valadas commented Dec 8, 2023

Copy link
Copy Markdown
Member

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

@valadas valadas added the bug Something isn't working label Dec 8, 2023
@valadas valadas changed the title Update Helpers.cs Fixed an issue where extra data was appended to end of downloaded file Dec 8, 2023
@valadas valadas added this to the 4.1.2 milestone Dec 8, 2023
@valadas valadas merged commit e1b1a2a into DNNCommunity:develop Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files downloaded have extra data appended to the end of them

3 participants