Update public/index.html
Browse files- public/index.html +14 -13
public/index.html
CHANGED
|
@@ -488,15 +488,16 @@
|
|
| 488 |
try {
|
| 489 |
const formData = new FormData(form);
|
| 490 |
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
|
|
|
| 500 |
|
| 501 |
clearInterval(progressInterval);
|
| 502 |
completeProgress();
|
|
@@ -506,10 +507,10 @@
|
|
| 506 |
<div style="font-size: 2rem; margin-bottom: 15px;">🎉</div>
|
| 507 |
<strong style="color: #4caf50; font-size: 1.2rem;">Upload Successful!</strong>
|
| 508 |
<div style="margin: 15px 0; padding: 15px; background: rgba(76, 175, 80, 0.1); border-radius: 8px;">
|
| 509 |
-
<div style="margin-bottom: 8px;"><strong>File:</strong> ${
|
| 510 |
-
<div style="margin-bottom: 15px;"><strong>Size:</strong> ${
|
| 511 |
<div><strong>Permanent Link:</strong></div>
|
| 512 |
-
<a href="${
|
| 513 |
</div>
|
| 514 |
<div style="color: #9d8bcc; font-size: 0.9rem;">Your file is now permanently hosted and accessible worldwide! 🌍</div>
|
| 515 |
</div>
|
|
@@ -523,7 +524,7 @@
|
|
| 523 |
|
| 524 |
result.innerHTML = `
|
| 525 |
<strong style="color: #ff6b6b;">Upload Failed</strong>
|
| 526 |
-
<div style="margin-top: 10px; color: #ffb3b3;">Please try again or contact support if the problem persists.</div>
|
| 527 |
`;
|
| 528 |
result.className = 'result error';
|
| 529 |
result.style.display = 'block';
|
|
|
|
| 488 |
try {
|
| 489 |
const formData = new FormData(form);
|
| 490 |
|
| 491 |
+
const response = await fetch('https://nexusv1-uploadx.hf.space/upload', {
|
| 492 |
+
method: 'POST',
|
| 493 |
+
body: formData
|
| 494 |
+
});
|
| 495 |
+
|
| 496 |
+
if (!response.ok) {
|
| 497 |
+
throw new Error(`HTTP error! status: ${response.status}`);
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
const data = await response.json();
|
| 501 |
|
| 502 |
clearInterval(progressInterval);
|
| 503 |
completeProgress();
|
|
|
|
| 507 |
<div style="font-size: 2rem; margin-bottom: 15px;">🎉</div>
|
| 508 |
<strong style="color: #4caf50; font-size: 1.2rem;">Upload Successful!</strong>
|
| 509 |
<div style="margin: 15px 0; padding: 15px; background: rgba(76, 175, 80, 0.1); border-radius: 8px;">
|
| 510 |
+
<div style="margin-bottom: 8px;"><strong>File:</strong> ${fileInput.files[0].name}</div>
|
| 511 |
+
<div style="margin-bottom: 15px;"><strong>Size:</strong> ${formatFileSize(fileInput.files[0].size)}</div>
|
| 512 |
<div><strong>Permanent Link:</strong></div>
|
| 513 |
+
<a href="${data.viewLink}" target="_blank" class="result-link" style="font-size: 1.1rem;">${data.viewLink}</a>
|
| 514 |
</div>
|
| 515 |
<div style="color: #9d8bcc; font-size: 0.9rem;">Your file is now permanently hosted and accessible worldwide! 🌍</div>
|
| 516 |
</div>
|
|
|
|
| 524 |
|
| 525 |
result.innerHTML = `
|
| 526 |
<strong style="color: #ff6b6b;">Upload Failed</strong>
|
| 527 |
+
<div style="margin-top: 10px; color: #ffb3b3;">Error: ${error.message}. Please try again or contact support if the problem persists.</div>
|
| 528 |
`;
|
| 529 |
result.className = 'result error';
|
| 530 |
result.style.display = 'block';
|