Search code examples
androidqtqmlqt-quick

QML save image file on device


I have successfully downloaded image file from web by sending it with base64 from server. I used this tutorial to save that image on the device, but I need to specify the image directory according to different devices so I used the QStandardPaths::writableLocation(QStandardPaths::DataLocation) as the saveURL. The issue is that the directory returned looks like

/data/data/org.qtproject.example.WierszeApp/files/.local/share/libWierszeApp.so

and there is no way to read saved file. Also calling .cdUp() on the dir returns false as it's probably non readable/writable. What makes me dizzy is why does it return a file with .so extension? When I save it to hardcoded location like /sdcard/Download/ then I have no trouble.


Solution

  • From the horse's mouth:

    The storage location returned can be a directory that does not exist; i.e., it may need to be created by the system or the user."

    There's nothing wrong with naming a directory with a .so extension. It's just the scheme that Qt has chosen, for whatever reason.