Closed AlbertMN closed 1 year ago
this doesn't parse the content disposition to extract the filename. should be easy to adapt lines 36-40 of the original code to do this
@stewartoallen that should be the case with this line here; https://github.com/GridSpace/grid-apps/pull/220/commits/ab7e806b5cbb4d77d4da07cbc698eb94177c8602#diff-71dd6b11160ea3c8cf6590b3333161717ea829a22af616b4d5ea126c1cd581aeR38 - it's just more simple now.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
specifically, the content of the header we need to parse out
Content-Disposition: attachment; filename="filename.jpg"
the line you highlighted returns the raw content of the header field
Ah, I see - figured it just returned the filename, but you're right - fixing now.
@stewartoallen done
Use
fetch
instead ofXHR
& implementcredentials
parameter to allow credential / cookie sharing in requests.