Error 2103: file could not be created

I’m trying to save a file in the assets directory, I’m using the file resource to perform the operation and I request the necessary permissions for the action, however I get Error 2103.

Please if anyone knows what I’m doing wrong, would be grateful to be guided with corrective actions in my block

Here you don’t even know where to start listing all mistakes.
You should first learn a few basics before you ask any questions here.

  1. TaifunTools.PathToAssets only works in connection with a WebView.
    (But it is no longer needed, because you can also use this: http://localhost/test.html)
  2. Assets are read-only.
  3. Storage permissions are only required to be able to access the external storage. Saving / writing to an arbitrary folder of the external storage is no longer possible on Android 11+.

See also here:

2 Likes

How can I save a screenshot to gallery tho in android 11 and higher?

store the images to shared storage and use the GalleryRefresh method from the tools extension

Taifun

well I just use the share component to share it but still would be nice no save it to gallery

I did search the community and did see this reply of you to someone else but how
like I get the I idea but how? :sweat_smile:

as already said, use the GalleryRefresh method from the tools extension
Taifun

I get this part I meant to ask how to store things in shared storage?

Just use the correct path, for example /Download/myFile.jpg

What about providing a screenshot of your relevant blocks?

Taifun

well that’s my current set up I gave up on trying to save to gallery I’ll try to do what u said…
image

The screenshot extension stores the file in the ASD… a quick look into the documentation helps… App Inventor Extensions: Take Screenshot | Pura Vida Apps

Which means, if you want to see the screenshot in the Gallery, you have to move or copy it to shared storage and additionally use the Gallery Refresh method…

Taifun

I swear I read the documentations before asking I understand everything about how the extension works my issue as I said is the actual way to move the file from ASD to anywhere else on device :sweat_smile:

using the file component?

yes
alternatively you also can use one of the file extensions
Taifun