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?
is this some sort of SVG or what particular asset is this?
May you be able to send the file here so I could also try ? 😄
user G
, .jpg, I don't see this problems with .png & .mp4
I remember before, there was a problem with SVG files. oh. where did you download them?
user G
, I download them from another sanity dataset using this way
interesting. does it happen to all jpg files?
user G
, I'm checking it now, I'll write after several minutes
thanks. it’s also interesting to check whether if you download it from the Sanity, can you able to reproduce the said issue?
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 }
);
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.
user G
, So this is probably a problem on my end?
Are you using Vercel or Netlify or something similar? I would check whether
fs
is available.
One way your file is intact is if you try different size of images . The image sizes should also be different per upload.
user G
, thanks, man)
welcome. i wish you success 😊

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?