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?
I am going to use the Generate Geodatabase Example in App Studio.
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<SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> networkRequestComponent NetworkRequest<SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> networkRequest property <SPAN class="keyword token">var</SPAN> name<SPAN class="punctuation token">;</SPAN> property <SPAN class="keyword token">var</SPAN> callback<SPAN class="punctuation token">;</SPAN> method<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"GET"</SPAN> ignoreSslErrors<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN> onReadyStateChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>readyState <SPAN class="operator token">===</SPAN> NetworkRequest<SPAN class="punctuation token">.</SPAN>DONE <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>errorCode <SPAN class="operator token">!=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> fileFolder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">removeFile</SPAN><SPAN class="punctuation token">(</SPAN>networkRequest<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> loadStatus <SPAN class="operator token">=</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> loadStatus <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">hasOfflineMap</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> fileFolder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">removeFile</SPAN><SPAN class="punctuation token">(</SPAN>itemId<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> fileFolder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">renameFile</SPAN><SPAN class="punctuation token">(</SPAN>name<SPAN class="punctuation token">,</SPAN> itemName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="token function">hasOfflineMap</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="token function">callback</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="token function">downloadFile</SPAN><SPAN class="punctuation token">(</SPAN>name<SPAN class="punctuation token">,</SPAN> url<SPAN class="punctuation token">,</SPAN> path<SPAN class="punctuation token">,</SPAN> callback<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> networkRequest<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">=</SPAN> name<SPAN class="punctuation token">;</SPAN> networkRequest<SPAN class="punctuation token">.</SPAN>url <SPAN class="operator token">=</SPAN> url<SPAN class="punctuation token">;</SPAN> networkRequest<SPAN class="punctuation token">.</SPAN>responsePath <SPAN class="operator token">=</SPAN> path<SPAN class="punctuation token">;</SPAN> networkRequest<SPAN class="punctuation token">.</SPAN>callback <SPAN class="operator token">=</SPAN> callback<SPAN class="punctuation token">;</SPAN> networkRequest<SPAN class="punctuation token">.</SPAN><SPAN class="token function">send</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> loadStatus <SPAN class="operator token">=</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.