From 36d6ebea20cab6ef381eb5c0e58c7e3bdaa796a3 Mon Sep 17 00:00:00 2001 From: highperfocused <24775431+mroxso@users.noreply.github.com> Date: Sat, 22 Mar 2025 13:25:02 +0100 Subject: [PATCH] change upload to use /media instead of /upload to blossom servers --- components/UploadComponent.tsx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/components/UploadComponent.tsx b/components/UploadComponent.tsx index 32ce98f..f838018 100644 --- a/components/UploadComponent.tsx +++ b/components/UploadComponent.tsx @@ -198,16 +198,16 @@ const UploadComponent: React.FC = () => { // If file is present, upload it to the media server if (file) { try { - // Remove EXIF data from image if it's an image file - if (file.type.startsWith("image/")) { - try { - file = await removeExifData(file) - console.log("EXIF data removed from image") - } catch (error) { - console.error("Error removing EXIF data:", error) - // Continue with original file if EXIF removal fails - } - } + // // Remove EXIF data from image if it's an image file + // if (file.type.startsWith("image/")) { + // try { + // file = await removeExifData(file) + // console.log("EXIF data removed from image") + // } catch (error) { + // console.error("Error removing EXIF data:", error) + // // Continue with original file if EXIF removal fails + // } + // } // Helper function to read file as ArrayBuffer const readFileAsArrayBuffer = (file: File): Promise => { @@ -240,7 +240,7 @@ const UploadComponent: React.FC = () => { content: desc, created_at: createdAt, tags: [ - ["t", "upload"], + ["t", "media"], ["x", sha256], ["expiration", newExpirationValue()], ], @@ -260,7 +260,7 @@ const UploadComponent: React.FC = () => { const blossomServer = "https://" + serverChoice - await fetch(blossomServer + "/upload", { + await fetch(blossomServer + "/media", { method: "PUT", body: file, headers: { authorization: "Nostr " + authString }, @@ -377,9 +377,9 @@ const UploadComponent: React.FC = () => { blossom.band - blossom.primal.net + {/* blossom.primal.net */} media.lumina.rocks - nostr.download + {/* nostr.download */}