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

Preserve filename in temporary downloads #7599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ram-Z
Copy link
Contributor

@Ram-Z Ram-Z commented Mar 5, 2023

When downloading a file into a temporary location for external open or pdfjs, it used to prepend a random string to the filename. This means that downloading a file opened with pdfjs would have an unwanted mangled filename.

Instead of adding a prefix to the filename, this puts the file with its filename intact in a unique temporary directory.

Noteworthy changes:

  • the restriction that filename must not contain a path separator has been lifted, it seems to work just fine (on linux)
    • introduced in b96898d
    • filename is obviously not a good name anymore if it contains path separators

@alkim0
Copy link

alkim0 commented Mar 11, 2023

The yet-to-be-merged #5261 may be related here.

@Ram-Z
Copy link
Contributor Author

Ram-Z commented Mar 11, 2023

Ah thanks, I did not see that one. Or the open issues regarding this. #5241

My approach is quite different, so I'll leave this one up for review too.

@Ram-Z Ram-Z force-pushed the preserve-filename-in-tempdownload branch 2 times, most recently from b8cfe9e to d8db991 Compare March 11, 2023 17:27
@Ram-Z Ram-Z force-pushed the preserve-filename-in-tempdownload branch 2 times, most recently from 58047ae to 01e12bc Compare March 19, 2023 14:29
@The-Compiler The-Compiler added this to Intertwined in Pull request backlog Apr 27, 2023
@Ram-Z Ram-Z force-pushed the preserve-filename-in-tempdownload branch from 01e12bc to c465e92 Compare August 20, 2023 19:48
@Ram-Z Ram-Z force-pushed the preserve-filename-in-tempdownload branch from c465e92 to 5dd6e06 Compare September 22, 2023 09:46
When downloading a file into a temporary location for external open or pdfjs, it used to
prepend a random string to the filename. This means that downloading a file opened with
pdfjs would have an unwanted mangled filename.

Instead of adding a prefix to the filename, this puts the file with its filename intact
in a unique temporary directory.
@Ram-Z Ram-Z force-pushed the preserve-filename-in-tempdownload branch from 5dd6e06 to edff7c3 Compare February 19, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Pull request backlog
  
Intertwined
Development

Successfully merging this pull request may close these issues.

None yet

2 participants