I can not download any image on iOS but works perfectly on Windows and Android.
NetworkRequest { id: networkRequest url: "https://example.example.com/api/currentimage" responsePath:AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/pipo.jpg") headers.json: {"My-Key": "PIPO"} property url imagePath: AppFramework.resolvedPathUrl(responsePath) onReadyStateChanged: { if ( readyState === NetworkRequest.DONE ) { //console.log("downloaded image") selected.obtainedImagePath = imagePath; busyIndicator.running=false; //console.log(imagePath) selected.mustUpdate = false; } } }
Any idea?
Solved! Go to Solution.
Hi Jorge,
Thank you for your reply.
I have rewritten the example as a complete working application so you should no longer have issues running it.
In my of my code today, I now use the FileInfo object, with this:
I hope you find this example more useful.
Stephen
Make sure the folder exists.
Use FileFolder.makeFolder() to do this.
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ArcGIS.AppFramework 1.0
App {
id: app
width: 400
height: 640
property FileInfo target: FileInfo { filePath: "~/ArcGIS/AppStudio/Images/logo.png" }
ColumnLayout {
anchors.fill: parent
anchors.margins: 10
Image {
id: image
}
NetworkRequest {
id: networkRequest
url: "https://appstudio.arcgis.com/images/index/logo-appstudio.png"
responsePath: target.filePath
onReadyStateChanged: {
if ( readyState !== NetworkRequest.ReadyStateComplete ) return;
image.source = target.url
}
}
Button {
text: qsTr("Download Now")
onClicked: {
target.folder.makeFolder();
networkRequest.send();
}
}
Item {
Layout.fillHeight: true
}
}
}
The FileFolder don't have a property named filePath... That throws me an error.
If i change it to path, then throws this error:
TypeError: Property 'makeFolder' of object function() { [native code] } is not a function
Have you tried that code before posting it?
Hi Jorge,
Thank you for your reply.
I have rewritten the example as a complete working application so you should no longer have issues running it.
In my of my code today, I now use the FileInfo object, with this:
I hope you find this example more useful.
Stephen