Fossil SCM
Seem to have resolved the broken download names for chat-posted files.
Commit
b604154c3822b45e4b0be16d3373b9fd249b8a3da715cb4bec3de61a98521904
Parent
eb7845f33982b3f…
1 file changed
+3
-1
+3
-1
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -150,11 +150,13 @@ | ||
| 150 | 150 | img.src = "chat-download/" + m.msgid; |
| 151 | 151 | span.appendChild(img); |
| 152 | 152 | }else{ |
| 153 | 153 | let a = document.createElement("a"); |
| 154 | 154 | let txt = "(" + m.fname + " " + m.fsize + " bytes)"; |
| 155 | - a.href = window.fossil.rootPath+'chat-download/' + m.msgid; | |
| 155 | + a.href = window.fossil.rootPath+ | |
| 156 | + 'chat-download/' + m.msgid+'/'+encodeURIComponent(m.fname); | |
| 157 | + // ^^^ add m.fname to URL to cause downloaded file to have that name. | |
| 156 | 158 | a.appendChild(textNode(txt)); |
| 157 | 159 | span.appendChild(a); |
| 158 | 160 | } |
| 159 | 161 | let br = document.createElement("br"); |
| 160 | 162 | br.style.clear = "both"; |
| 161 | 163 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -150,11 +150,13 @@ | |
| 150 | img.src = "chat-download/" + m.msgid; |
| 151 | span.appendChild(img); |
| 152 | }else{ |
| 153 | let a = document.createElement("a"); |
| 154 | let txt = "(" + m.fname + " " + m.fsize + " bytes)"; |
| 155 | a.href = window.fossil.rootPath+'chat-download/' + m.msgid; |
| 156 | a.appendChild(textNode(txt)); |
| 157 | span.appendChild(a); |
| 158 | } |
| 159 | let br = document.createElement("br"); |
| 160 | br.style.clear = "both"; |
| 161 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -150,11 +150,13 @@ | |
| 150 | img.src = "chat-download/" + m.msgid; |
| 151 | span.appendChild(img); |
| 152 | }else{ |
| 153 | let a = document.createElement("a"); |
| 154 | let txt = "(" + m.fname + " " + m.fsize + " bytes)"; |
| 155 | a.href = window.fossil.rootPath+ |
| 156 | 'chat-download/' + m.msgid+'/'+encodeURIComponent(m.fname); |
| 157 | // ^^^ add m.fname to URL to cause downloaded file to have that name. |
| 158 | a.appendChild(textNode(txt)); |
| 159 | span.appendChild(a); |
| 160 | } |
| 161 | let br = document.createElement("br"); |
| 162 | br.style.clear = "both"; |
| 163 |