<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">Hi Tim,<div><br></div><div>I have sent you the files. I have also been able to fix it I changed within File.pm I have changes "sub characters" FROM:</div><div><br></div><div>print $tmpfile MIME::Base64::decode_base64( substr($_,0,length($_) - length($_)%77) );</div><div><br></div><div>TO</div><div><br></div><div>print $tmpfile MIME::Base64::decode_base64( substr($_,0,length($_) - length($_)%4) );</div><div><br></div><div>this seem to stop the chunking from breaking up&nbsp;individual&nbsp;byes and causing the problem. I am still testing this but would be great to know what you think.</div><div><br></div><div>Jim</div><div><br></div><div><br><br><font color="#990099">-----eprints-tech-bounces@ecs.soton.ac.uk wrote: -----</font><div style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;">To: eprints-tech@ecs.soton.ac.uk<br>From: Tim Brody <tdb2@ecs.soton.ac.uk><br>Sent by: eprints-tech-bounces@ecs.soton.ac.uk<br>Date: 05/29/2012 03:50PM<br>Subject: [EP-tech] Re: Base64 decoding in 3.3<br><br><div><font face="Courier New,Courier,monospace" size="3">On Tue, 2012-05-29 at 12:18 +0100, James Colhoun wrote:<br>&gt; Hi,<br>&gt; <br>&gt; <br>&gt; I am uploading publications via sword, full text files are added to<br>&gt; the upload xml and encoded in base64 this worked fine until we<br>&gt; upgraded to 3.3. Now we get errors in the log:<br>&gt; <br>&gt; <br>&gt; &nbsp;failed: expected 3151 bytes but actually got 3149 bytes<br>&gt; <br>&gt; <br>&gt; So it seems the decoding of base64 is no longer working correctly.<br>&gt; Inside EPrints/DataObj/File.pm the functions: end_element, characters<br>&gt; and start_element seems to create a tmp file that is corrupt. &nbsp;If I<br>&gt; add a write to file inside "sub characters" (see below) the pdf is<br>&gt; created correctly so I know the data is passed in correctly, there<br>&gt; seems to be something fundamentally broken with the way the decoding<br>&gt; to tmpfile is working. Has anyone seen this are have a fix for it?<br>&gt; <br>Hi,<br><br>I can't replicate this. I did find a bug in XMLFiles for *producing*<br>base64 encoded files, fixed by this:<br><a href="http://trac.eprints.org/eprints/ticket/4057">http://trac.eprints.org/eprints/ticket/4057</a><br><br>This could be an edge case - can you post your XML somewhere or email it<br>to me directly (if not too big)?<br><br>-- <br>All the best,<br>Tim<br></font></div><div><font face="Courier New,Courier,monospace" size="3">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><br>*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><br></font></div></tdb2@ecs.soton.ac.uk></div><br><br>[attachment "signature.asc" removed by James Colhoun/sisjc5/CardiffUniversity]</div></div></font>