<br><br><div><span class="gmail_quote">On 1/7/06, <b class="gmail_sendername">Till Adam</b> <<a href="mailto:adam@kde.org">adam@kde.org</a>> 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>> On 1/7/06, Till Adam <<a href="mailto:adam@kde.org">adam@kde.org</a>> wrote:<br>> > On Saturday 07 January 2006 12:57, Aditya Mooley wrote:<br>> > > QFile userfile(fileName);
<br>> > > if ( !userfile.open(IO_ReadOnly) ) {<br>> > > QMessageBox::information(this, tr("HTTP"),<br>> > > tr("Unable to open the file %1: %2.")<br>> > > .arg(openFilesPath).arg(
userfile.errorString()));<br>> > > }<br>> > > fileSize = userfile.size();<br>> > > userfile.readAll();<br>> ><br>> > Hm, you're not doing anything with teh read data here, so I can't really
<br>> > tell<br>> > what the problem could be. Can you post the full source, maybe, or send<br>> > it to<br>> > me in private mail?<br>><br>> Thanks for your prompt response. It's encouraging :)
<br>> 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*. <br>
<br>
Is there a "gotcha" for reading binary files using QFile::readAll() ?<br>
<br>
I have uploaded the source code here -> <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>=============================================================