<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to access the data received from FTP server?]]></title><description><![CDATA[<p dir="auto">Hi, I've been using this(<a href="https://doc.qt.io/qt-6/qtscxml-ftpclient-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qtscxml-ftpclient-example.html</a>) ftp client to receive data from ftp server and it's working as intended.</p>
<p dir="auto">It displays the text inside the txt file in application output.</p>
<p dir="auto">But my question here is how can I access it? Where is it stored? I want to write it to some other file.</p>
<p dir="auto">Actually I want to get an xml file from ftp client and save it to my computer that's my purpose.</p>
<p dir="auto">Thanks in advance.</p>
]]></description><link>https://forum.qt.io/topic/141278/how-to-access-the-data-received-from-ftp-server</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 13:44:18 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/141278.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Dec 2022 14:48:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to access the data received from FTP server? on Tue, 06 Dec 2022 14:54:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> This is the place where data is received:</p>
<pre><code>QObject::connect(&amp;dataChannel, &amp;FtpDataChannel::dataReceived,
                     [](const QByteArray &amp;data) {
        std::cout &lt;&lt; data.constData() &lt;&lt; std::flush;
    });
</code></pre>
<p dir="auto">Instead of simply printing it out you can accumulate the data returned by data.constData() in a member variable of type QByteArray. When the whole file was transferred you will have all the data in that member variable.<br />
Keep in mind that you should not do it this way if transferred file is big. In this case you can write what data.constData() returns into a file.</p>
]]></description><link>https://forum.qt.io/post/739169</link><guid isPermaLink="true">https://forum.qt.io/post/739169</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 06 Dec 2022 14:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the data received from FTP server? on Wed, 07 Dec 2022 07:07:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> said in <a href="/post/739171">How to access the data received from FTP server?</a>:</p>
<blockquote>
<p dir="auto">Also I assume I cannot take this as a file and directly save it?</p>
</blockquote>
<p dir="auto">Of course you can. I also wrote it in my previous post...</p>
]]></description><link>https://forum.qt.io/post/739278</link><guid isPermaLink="true">https://forum.qt.io/post/739278</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 07 Dec 2022 07:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the data received from FTP server? on Tue, 06 Dec 2022 15:21:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a><br />
nothing prevents you from saving the bytearray directly to a file.</p>
]]></description><link>https://forum.qt.io/post/739174</link><guid isPermaLink="true">https://forum.qt.io/post/739174</guid><dc:creator><![CDATA[mpergand]]></dc:creator><pubDate>Tue, 06 Dec 2022 15:21:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the data received from FTP server? on Tue, 06 Dec 2022 14:59:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> Thanks, how did I not see that :D.</p>
<p dir="auto">Also I assume I cannot take this as a file and directly save it?</p>
<p dir="auto">I have to take what I have and save it into a file so that means more work?</p>
]]></description><link>https://forum.qt.io/post/739171</link><guid isPermaLink="true">https://forum.qt.io/post/739171</guid><dc:creator><![CDATA[kayakaan02]]></dc:creator><pubDate>Tue, 06 Dec 2022 14:59:00 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the data received from FTP server? on Tue, 06 Dec 2022 14:54:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> This is the place where data is received:</p>
<pre><code>QObject::connect(&amp;dataChannel, &amp;FtpDataChannel::dataReceived,
                     [](const QByteArray &amp;data) {
        std::cout &lt;&lt; data.constData() &lt;&lt; std::flush;
    });
</code></pre>
<p dir="auto">Instead of simply printing it out you can accumulate the data returned by data.constData() in a member variable of type QByteArray. When the whole file was transferred you will have all the data in that member variable.<br />
Keep in mind that you should not do it this way if transferred file is big. In this case you can write what data.constData() returns into a file.</p>
]]></description><link>https://forum.qt.io/post/739169</link><guid isPermaLink="true">https://forum.qt.io/post/739169</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 06 Dec 2022 14:54:26 GMT</pubDate></item></channel></rss>