comparison src/chat.js @ 93:d0566cc4a2ac default tip

uploa fix
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Apr 2025 19:47:48 -0600
parents c41e200c3e76
children
comparison
equal deleted inserted replaced
92:c41e200c3e76 93:d0566cc4a2ac
326 } 326 }
327 327
328 function uploadToFilebin(fileName,fileContent) { 328 function uploadToFilebin(fileName,fileContent) {
329 //console.log(fileContent.byteLength); 329 //console.log(fileContent.byteLength);
330 let request = new XMLHttpRequest(); 330 let request = new XMLHttpRequest();
331 let url = filebinUrl + fileName; 331 let url = filebinUrl + encodeURIComponent(fileName);
332 request.open( 'POST', url ); 332 request.open( 'POST', url );
333 request.onload = function() { 333 request.onload = function() {
334 if( request.status !== 201 ) { 334 if( request.status !== 201 ) {
335 let err = 'upload failed: ' + request.status; 335 let err = 'upload failed: ' + request.status;
336 if( request.responseText ) { 336 if( request.responseText ) {