Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › FileDialog: get file path to read file from files like "content://…"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24371

    Volker

    Hi,

    I use FileDialog to upload file on server and on Android file looks like “content://com.android.providers.media.documents/document/image%3A133” if I select an image. Is there an easy way to convert it to real file path in order to open file in C++ code?

    Regards

    Roman

    #24373

    Alex
    Felgo Team

    Hi Volker,

    are you referring to the Qt.labs FileDialog? https://doc.qt.io/qt-5/qml-qt-labs-platform-filedialog.html

    The problem is that on Android this Qt component does not fully support all cases, and required persistance handling to re-access the file after fetching it using the dialog. This is also partly covered in this thread: https://forum.qt.io/topic/113328/how-to-convert-android-content-url-and-use-it-to-open-file

    If this is only about images, did you try using the image picker method from the Felgo NativeUtils instead? https://felgo.com/doc/apps-howto-display-images-and-photos/#selecting-a-photo-from-the-gallery

    Best,
    Alex

    #24379

    Volker

    Hi Alex,

    yes, I’m using FileDialog and saw this post, but found suggested solutions too complicated for such simple case and I hoped Felgo has something that provide simple solution for this. Unfortunately I need the possibility to attach any file for transmission like mail application does it with attachments…

    #24380

    Alex
    Felgo Team

    Hi Volker,

    I would suggest to also ask this in the Qt forums directly, maybe there is another trick to it. We do not have a custom file picker for any file type on top of the Qt components at the moment.

    Best,
    Alex

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded