File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
66and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
77
8+ ## Unreleased
9+
10+ ### Fixed
11+ - When downloading a file with a ` ' ` in the name it would save the file as blob
12+
813## 1.20.1 - 2022-04-04
914
1015### Fixed
Original file line number Diff line number Diff line change @@ -856,37 +856,20 @@ object FileUtils {
856856 // Download CONTENT-DISPOSITION encoding
857857 //
858858 def encodeAttachment (filename : String , userAgent : String ) : String = {
859- val filenameStar = if (userAgent.indexOf(" MSIE" ) > - 1 ) {
860- URLEncoder .encode(filename, " UTF-8" )
861- } else if (userAgent.indexOf(" Edge" ) > - 1 ){
862- MimeUtility .encodeText(filename
863- .replaceAll(" ," ," %2C" )
864- .replaceAll(" \" " ," %22" )
865- .replaceAll(" /" ," %2F" )
866- .replaceAll(" =" ," %3D" )
867- .replaceAll(" &" ," %26" )
868- .replaceAll(" :" ," %3A" )
869- .replaceAll(" ;" ," %3B" )
870- .replaceAll(" \\ ?" ," %3F" )
871- .replaceAll(" \\ *" ," %2A" )
859+ val filenameStar = MimeUtility .encodeText(filename
860+ .replaceAll(" %" ," %25" )
861+ .replaceAll(" " ," %20" )
862+ .replaceAll(" \" " ," %22" )
863+ .replaceAll(" '" ," %27" )
864+ .replaceAll(" ," ," %2C" )
865+ .replaceAll(" /" ," %2F" )
866+ .replaceAll(" =" ," %3D" )
867+ .replaceAll(" :" ," %3A" )
868+ .replaceAll(" ;" ," %3B" )
869+ .replaceAll(" \\ *" ," %2A" )
872870 ," utf-8" ," Q" )
873- } else {
874- MimeUtility .encodeText(filename
875- .replaceAll(" %" ," %25" )
876- .replaceAll(" " ," %20" )
877- .replaceAll(" \" " ," %22" )
878- .replaceAll(" ," ," %2C" )
879- .replaceAll(" /" ," %2F" )
880- .replaceAll(" =" ," %3D" )
881- .replaceAll(" :" ," %3A" )
882- .replaceAll(" ;" ," %3B" )
883- .replaceAll(" \\ *" ," %2A" )
884- ," utf-8" ," Q" )
885- }
886- Logger .debug(userAgent + " : " + filenameStar)
887871
888872 // Return the complete attachment header info
889873 " attachment; filename*=UTF-8''" + filenameStar
890874 }
891-
892875}
You can’t perform that action at this time.
0 commit comments