Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Get file text with QML/Javascript

I have a file picker that lets the user select a text file. How can I get the contents of the text file into a javascript variable? 

 

FilePicker {

            id: picker

 

            property string selectedFile

 

            title: qsTr("File Picker")

            mode: pickerMode.selectedValue

            type: pickerType.selectedValue

            viewMode: pickerViewMode.selectedValue

            sortBy: pickerSortBy.selectedValue

            sortOrder: pickerSortOrder.selectedValue

 

            onFileSelected: {

                selectedFile = selectedFiles[0]

                console.log("PK - "+selectedFile)

            }

        }

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Get file text with QML/Javascript

Please use plain text.