Problems with defold-sharing

Below the MDN text example there is another example that shares an image wich works fine.

Ok. Well, I don’t know what the problem is then to be honest. The image sharing code is here:

You’re welcome to try and make changes to it to get it to work.

One thing might be the fact that the code doesn’t set a mime type. That could be the reason for the permission error. We could use the file extension to look up the correct mime type.

Im having a look to see if i can figure it out… but I’m still a bit lost.
Im trying to modify the library to hardcode ->( type: “image/png”)

         var file = new File([image_data], file_name, { type: "image/png"  });

But can’t work out how to modify the library. :confused:
Should I open an issue in github?

You can either download the source code and put it in your own project or make a copy of it to your own user on GitHub (called a Fork): Fork a repo - GitHub Docs

Once you have a copy you make the modifications there and use the copy instead.

1 Like

By the way, I added the code here:

You can give that a try and see if it helps to also provide the mime type!

3 Likes

Yaaay!! you fixed it! that’s fantastic, thankyou! ^^

Oh, it works?!

2 Likes

yeah all good now! :slight_smile:

1 Like