FTP Download

864
3
Jump to solution
01-02-2020 10:28 AM
jaykapalczynski
Frequent Contributor

I am looking for a simple example of how to connect to and download a file using QML/Qt

anyone have any examples or thoughts?

0 Kudos
1 Solution

Accepted Solutions
jaykapalczynski
Frequent Contributor

I am going to use the Generate Geodatabase Example in App Studio.

View solution in original post

0 Kudos
3 Replies
jaykapalczynski
Frequent Contributor

I am looking at this example: QFtp Class | Qt 4.8 

It shows it connecting to a FTP site url and then I think Changes directory to "qt"? then looks for file "INSTALL"?

My file would always be the same name.  Just want a button to:

1. Go to the FTP site

2. Find the file

3. Download it to a Specific location

4. close

First time doing this and quite confused.  Where do I specify credentials?  This has to be secured.

0 Kudos
jaykapalczynski
Frequent Contributor

I am also looking at this snip of code and am thinking that I might be able to go get a file from my AGOL account?

All I am after is grabbing the newest file from the server and replacing the one on the phone.  a simply .geodatabase file

Not sure how to proceed with this ....anyone have any thoughts?

Again I am simply trying to allow a user to download and replace a .geodatabase file on their mobile device.

    Component{
        id: networkRequestComponent
        NetworkRequest{
            id: networkRequest

            property var name;
            property var callback;

            method: "GET"
            ignoreSslErrors: true

            onReadyStateChanged: {
                if (readyState === NetworkRequest.DONE ){
                    if(errorCode != 0){
                        fileFolder.removeFile(networkRequest.name);
                        loadStatus = 2;
                    } else {
                        loadStatus = 0;
                        if(hasOfflineMap()) fileFolder.removeFile(itemId);
                        fileFolder.renameFile(name, itemName);
                        hasOfflineMap();
                        callback();
                    }
                }
            }
            function downloadFile(name, url, path, callback){
                networkRequest.name = name;
                networkRequest.url = url;
                networkRequest.responsePath = path;
                networkRequest.callback = callback;
                networkRequest.send();
                loadStatus = 1;
            }
        }
    }

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
0 Kudos
jaykapalczynski
Frequent Contributor

I am going to use the Generate Geodatabase Example in App Studio.

0 Kudos