Spaces:
Runtime error
Runtime error
Update share_btn.py
Browse files- share_btn.py +2 -2
share_btn.py
CHANGED
@@ -4,7 +4,7 @@ share_js = """async () => {
|
|
4 |
const response = await fetch(UPLOAD_URL, {
|
5 |
method: 'POST',
|
6 |
headers: {
|
7 |
-
'Content-Type':
|
8 |
'X-Requested-With': 'XMLHttpRequest',
|
9 |
},
|
10 |
body: file, /// <- File inherits from Blob
|
@@ -48,7 +48,7 @@ share_js = """async () => {
|
|
48 |
const urls = await Promise.all([...imgEls].map((imgEl) => {
|
49 |
const origURL = imgEl.src;
|
50 |
const imgId = Date.now() % 200;
|
51 |
-
const fileName = 'stream-multi-diffusion-' + imgId + '.
|
52 |
return toDataURL(origURL)
|
53 |
.then(dataUrl => {
|
54 |
return dataURLtoFile(dataUrl, fileName);
|
|
|
4 |
const response = await fetch(UPLOAD_URL, {
|
5 |
method: 'POST',
|
6 |
headers: {
|
7 |
+
'Content-Type': 'image/webp',
|
8 |
'X-Requested-With': 'XMLHttpRequest',
|
9 |
},
|
10 |
body: file, /// <- File inherits from Blob
|
|
|
48 |
const urls = await Promise.all([...imgEls].map((imgEl) => {
|
49 |
const origURL = imgEl.src;
|
50 |
const imgId = Date.now() % 200;
|
51 |
+
const fileName = 'stream-multi-diffusion-' + imgId + '.webp';
|
52 |
return toDataURL(origURL)
|
53 |
.then(dataUrl => {
|
54 |
return dataURLtoFile(dataUrl, fileName);
|