<?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[[SOLVED] Using QHttpMultipart for a HTML form]]></title><description><![CDATA[<p dir="auto">Greetings!</p>
<p dir="auto">I got a problem with QNetworkAccessmanager::post() method in uploading a file programmatically using QHttpMultipart.</p>
<p dir="auto">I got success using an HTML form via QWebView. The HTML form looks like this:</p>
<p dir="auto">@&lt;form method="post" action="[url value received in response]" enctype="multipart/form-data"&gt;<br />
&lt;!-- MUST FIELDS --&gt;<br />
&lt;input type="hidden" name="MAX_FILE_SIZE" value="[max_file_size value received in response]"&gt;<br />
&lt;input type="hidden" name="UPLOAD_IDENTIFIER" value="[upload_identifier value received in response]"&gt;<br />
&lt;input type="hidden" name="extra_info" value="[extra_info value received in response]"&gt;<br />
&lt;input type="file" name="userfile"&gt;<br />
&lt;input type="submit" value="Submit"&gt;<br />
&lt;/form&gt;@</p>
<p dir="auto">It doesn't help a lot since I need to select a file (without user interaction) and submit it to a certain url. I followed the guide in the QHttpmultipart documentation but "fails" every-time.</p>
]]></description><link>https://forum.qt.io/topic/21034/solved-using-qhttpmultipart-for-a-html-form</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 07:11:44 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21034.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Nov 2012 11:34:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Using QHttpMultipart for a HTML form on Thu, 21 Feb 2013 14:29:55 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="dv879" date="1361446791"]Thank you <em>Code_ReaQtor</em> for sharing the link to TuckDesign's solution. It really does the trick! :)[/quote]</p>
<p dir="auto">Sure. You're welcome.</p>
]]></description><link>https://forum.qt.io/post/168071</link><guid isPermaLink="true">https://forum.qt.io/post/168071</guid><dc:creator><![CDATA[Code_ReaQtor]]></dc:creator><pubDate>Thu, 21 Feb 2013 14:29:55 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Using QHttpMultipart for a HTML form on Thu, 21 Feb 2013 11:39:51 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <em>Code_ReaQtor</em> for sharing the link to TuckDesign's solution. It really does the trick! :)</p>
]]></description><link>https://forum.qt.io/post/168044</link><guid isPermaLink="true">https://forum.qt.io/post/168044</guid><dc:creator><![CDATA[dv879]]></dc:creator><pubDate>Thu, 21 Feb 2013 11:39:51 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Using QHttpMultipart for a HTML form on Sun, 11 Nov 2012 06:16:49 GMT]]></title><description><![CDATA[<p dir="auto">Seems like my method is too buggy. Sometimes it uploads a file and sometimes it doesn't.... I don't know why.</p>
<p dir="auto">Well, I found a solution from "TuckDesgin":<a href="http://www.tuckdesign.com/sources/Qt" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.tuckdesign.com/sources/Qt</a> and modified it.</p>
<p dir="auto">... and it worked for me everytime, I just need to test it again and again just to make sure.</p>
]]></description><link>https://forum.qt.io/post/156629</link><guid isPermaLink="true">https://forum.qt.io/post/156629</guid><dc:creator><![CDATA[Code_ReaQtor]]></dc:creator><pubDate>Sun, 11 Nov 2012 06:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Using QHttpMultipart for a HTML form on Sun, 04 Nov 2012 13:13:46 GMT]]></title><description><![CDATA[<p dir="auto">I already solved it. Seems like there is something wrong with the documentation for QHttpMultiPart. The documentation points out RFC 2046 but can't find the answer as I search for it.</p>
<p dir="auto">I was able to google RFC 1867 which solved the problem.</p>
<p dir="auto">In the documentation:<br />
@QHttpPart imagePart;<br />
imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg"));<br />
imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name="image""));@</p>
<p dir="auto">I think the problem was that ContentDispositionHeader should come first before ContentTypeHeader.<br />
I tried this using the "file" input control and not with an "image" as cited in the code;</p>
]]></description><link>https://forum.qt.io/post/156113</link><guid isPermaLink="true">https://forum.qt.io/post/156113</guid><dc:creator><![CDATA[Code_ReaQtor]]></dc:creator><pubDate>Sun, 04 Nov 2012 13:13:46 GMT</pubDate></item></channel></rss>