WPChill / download-monitor

A WordPress plugin which provides an intuitive UI for uploading and managing downloadable files (including support for multiple versions), inserting download links into posts & logging downloads.
http://wordpress.org/extend/plugins/download-monitor/
262 stars 117 forks source link

downloaded file name in response headers #1253

Closed mplusb closed 1 year ago

mplusb commented 1 year ago

Describe the bug Hi, I think I found a bug in version 4.7.78 on Chrome. Basically, in file dlm-xhr.js when you look for downloaded file name in response headers, there is a fallback function (line 208 and on in uncompressed file) that reads header "content-disposition" and splits by "filename=" to get filename I have a wordpress website where, only in Chrome, the "content-disposition" header looks different, like: ...filename*=UTF-8''my-file-name.xls; instead of ...filename=my-file-name.xls;

I'd like you to investigate further this problem and maybe include this fix on next release I fixed this way:

if( 'undefined' == typeof file_name ){ file_name = responseHeaders['content-disposition'].split("filename*=UTF-8''")[1]; buttonObj.find('.dlm-xhr-loading-gif').remove(); } (after the "split" instruction to get file_name)

Extensions installed and activated:

Additional context https://secure.helpscout.net/conversation/2219064489/56431?folderId=4638445

razvanaldea89 commented 1 year ago

https://github.com/WPChill/download-monitor/issues/1260