<br><br><div><span class="gmail_quote">On 1/7/06, <b class="gmail_sendername">Till Adam</b> &lt;<a href="mailto:adam@kde.org">adam@kde.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Saturday 07 January 2006 13:43, you wrote:<br>&gt; On 1/7/06, Till Adam &lt;<a href="mailto:adam@kde.org">adam@kde.org</a>&gt; wrote:<br>&gt; &gt; On Saturday 07 January 2006 12:57, Aditya Mooley wrote:<br>&gt; &gt; &gt; QFile userfile(fileName);
<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; if ( !userfile.open(IO_ReadOnly) ) {<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QMessageBox::information(this, tr(&quot;HTTP&quot;),<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tr(&quot;Unable to open the file %1: %2.&quot;)<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .arg(openFilesPath).arg(
userfile.errorString()));<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; fileSize = userfile.size();<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; userfile.readAll();<br>&gt; &gt;<br>&gt; &gt; Hm, you're not doing anything with teh read data here, so I can't really
<br>&gt; &gt; tell<br>&gt; &gt; what the problem could be. Can you post the full source, maybe, or send<br>&gt; &gt; it to<br>&gt; &gt; me in private mail?<br>&gt;<br>&gt; Thanks for your prompt response. It's encouraging :)
<br>&gt; I am attaching the source code for you to see.<br><br>Hm, the file reading code looks correct. Does the right data get added to teh<br>ByteArray? If you print out the bytearray, after the readAll, for example,<br>
does it have the stuff in there?</blockquote><div><br>
First of all thanks to Till for looking into the code. The code is
working fine for text files. It is reading the file correctly and
showing correct file size and also the file gets uploaded using QHttp.
But for Binary files it is reading only *4 bytes*.&nbsp; <br>
<br>
Is there a &quot;gotcha&quot; for&nbsp; reading binary files using QFile::readAll() ?<br>
<br>
I have uploaded the source code here -&gt; <a href="http://sanisoft-demo.com/kdeDev/cpg.tar.gz">http://sanisoft-demo.com/kdeDev/cpg.tar.gz</a><br>
Please let me what's wrong in the code or am I missing something?<br>
I am using FC3 with KDE 3.3.1-2.2<br>
</div></div><br>Thanks again in advance for all your help.<br>
<br>
Regards,<br clear="all"><br>-- <br>Aditya<br>=============================================================<br>PHP Applications for E-Biz: <a href="http://www.sanisoft.com">http://www.sanisoft.com</a><br>Coppermine Picture Gallery: 
<a href="http://coppermine.sf.net">http://coppermine.sf.net</a><br>=============================================================