Trouble uploading recently downloaded assets from Sanity.io
15 replies
Last updated: Feb 27, 2023
D
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
D
is this some sort of SVG or what particular asset is this?
Feb 25, 2023, 12:56 PM
D
May you be able to send the file here so I could also try ? 😄
Feb 25, 2023, 12:56 PM
D
user G
, .jpg, I don't see this problems with .png & .mp4Feb 25, 2023, 12:57 PM
D
I remember before, there was a problem with SVG files. oh. where did you download them?
Feb 25, 2023, 12:57 PM
D
user G
, I download them from another sanity dataset using this wayFeb 25, 2023, 12:59 PM
D
interesting. does it happen to all jpg files?
Feb 25, 2023, 1:04 PM
D
user G
, I'm checking it now, I'll write after several minutesFeb 25, 2023, 1:05 PM
D
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
D
user G
, Hm... actually not only for .png it doesn't work.Try download this .png image from sanity using this linkhttps://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
D
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
D
user G
, So this is probably a problem on my end?Feb 26, 2023, 3:52 PM
D
Are you using Vercel or Netlify or something similar? I would check whether
fsis available.
Feb 27, 2023, 1:25 PM
D
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
D
user G
, thanks, man)Feb 27, 2023, 1:31 PM
D
welcome. i wish you success 😊
Feb 27, 2023, 1:38 PM
Sanity.io – build remarkable experiences at scale
Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.