✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Trouble uploading recently downloaded assets from Sanity.io

15 replies
Last updated: Feb 27, 2023
Hi all, why can't i upload asset, that i download several seconds ago? I downloaded this asset from the sanity, where does the metadata disappear to?
Feb 24, 2023, 5:17 PM
is this some sort of SVG or what particular asset is this?
Feb 25, 2023, 12:56 PM
May you be able to send the file here so I could also try ? 😄
Feb 25, 2023, 12:56 PM
user G
, .jpg, I don't see this problems with .png & .mp4
Feb 25, 2023, 12:57 PM
I remember before, there was a problem with SVG files. oh. where did you download them?
Feb 25, 2023, 12:57 PM
user G
, I download them from another sanity dataset using this way
Feb 25, 2023, 12:59 PM
interesting. does it happen to all jpg files?
Feb 25, 2023, 1:04 PM
user G
, I'm checking it now, I'll write after several minutes
Feb 25, 2023, 1:05 PM
thanks. it’s also interesting to check whether if you download it from the Sanity, can you able to reproduce the said issue?
Feb 25, 2023, 1:07 PM
user G
, Hm... actually not only for .png it doesn't work.Try download this .png image from sanity using this link

https://cdn.sanity.io/images/rlbee0fm/staging/0125546061818fdf0af8e5ad9ec35890655c0a66-1390x1020.png?dl=
And upload to some your sanity dataset, I do it using node.js like below

const uploadedAsset = await client.assets.upload(
assetType,
fs.createReadStream(path.join(__dirname, originalFilename)),
{ filename: originalFilename }
);
Feb 25, 2023, 1:22 PM
I have a feeling somehow in the backend side of things, the binaries got messed up. I’ll try this in a local setup I have but it’ll be for a while.
Feb 25, 2023, 5:50 PM
user G
, So this is probably a problem on my end?
Feb 26, 2023, 3:52 PM
Are you using Vercel or Netlify or something similar? I would check whether
fs
is available.
Feb 27, 2023, 1:25 PM
One way your file is intact is if you try different size of images . The image sizes should also be different per upload.
Feb 27, 2023, 1:26 PM
user G
, thanks, man)
Feb 27, 2023, 1:31 PM
welcome. i wish you success 😊
Feb 27, 2023, 1:38 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?