Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File download in Resource Manager #5551

Closed
4 tasks done
ssanscar opened this issue Feb 23, 2023 · 6 comments · Fixed by #5806
Closed
4 tasks done

File download in Resource Manager #5551

ssanscar opened this issue Feb 23, 2023 · 6 comments · Fixed by #5806

Comments

@ssanscar
Copy link

Description of bug

We can download files with the Resource Manager that names contains spaces, accents or special characters like parenthesis but the names of the downloaded files are renamed with underscore at the beginning and at the end of files.

Files without spaces, accents or special characters are downloaded successfully with the same name.

For the files with accents, the downloaded names is really weird like this:
=utf-8_B_UmFwcG9ydCBkdSBqdXJ5IHNvdXRlbmFuY2UgZGUgdGjDqHNlLnBkZg===.pdf

But, file name will always start with _=utf-8

Steps to reproduce

List the precise steps to reproduce the bug:

  1. Go to 'Persona Bar'.
  2. Click on 'Manage' and 'Site Assets'.
  3. Scroll folders to find file with spaces, accents or special characters. If you can't find files like that, just rename an existing file with the 'Edit' option of the 'Resource Manager' by a right-click on the existing file.
  4. After that, download the file with the 'Download' option on the 'Resource Manager' tools bar or by a right-click on the file.

Current behavior

The downloaded file can be open on the desktop but we need to rename it if we would like that Windows recognize the type of file for open the good associated application of the downloaded file.

Expected behavior

Conserve the name of the file.

Screenshots

image

Error information

No errors.

Additional context

I tried with a lot of files.

If I have accents, spaces, or special characters, I have the issue. But if my files are no spaces, etc. the file name downloaded is right.

If I rename the file under the Resource Manager without spaces, etc. the file name downloaded is right. Conversely, if I rename the file under the Resource Manager with a space, etc. the file name downloaded has the issue.

I also tried with a new Uploaded file, and I have the same issue.

Affected version

  • 09.11.01 latest supported release

Affected browser

  • Chrome
  • Firefox: names are good with spaces and special characters but the issue exist with weird name for a file with accents
  • Microsoft Edge (Classic)
@mitchelsellers
Copy link
Contributor

I believe this might be by design. Spaces, special characters, etc are NOT supported by all browser types and are not supported consistently across the board.

@valadas any thoughts?

@ssanscar
Copy link
Author

FYI, I know that the Resource Manager module with v9.11.0 is new but I don't have this issue with the Resource Manager of the DNN v9.10.2.

@david-poindexter
Copy link
Contributor

Very interesting. We may need to look into this one a bit further. Thanks so much for the detailed issue @ssanscar

@WillStrohl
Copy link
Contributor

Hello... Just an FYI, that this is also discussed briefly in the DNN forums.

@valadas
Copy link
Contributor

valadas commented Feb 23, 2023

I am not aware off-the-cuff of the code that might be adding those. In theory it should be able to download filenames with spaces in them. We'lll have to put a breakpoint and see why that is happeneing...

@JeffFrick
Copy link

Firefox doesn't add the underscores when downloaded. In my option, it would be nice if this behavior was consistent across the major browsers. My co-worker believes the issue is related to SSL authentication within the browsers. Safari also works fine on my iPhone. Edge and Chrome add the underscores. In Edge & Chrome you can get around this by using the "Copy URL" function and pasting the link in a new tab. (we had to add a certificate to our internal intranet in order to get the "Copy URL" function to appear.

valadas added a commit to valadas/Dnn.Platform that referenced this issue Sep 8, 2023
Closes dnnsoftware#5551

The string is quotes when there are spaces in the filement and Chrome replaced those with underscores.
Filenames with special characters are encoded in the response.
This adds a function to convert all those special cases back into a plain string that matches the actual filename in the frontend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

6 participants