EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #00645
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Base64 decoding in 3.3
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Base64 decoding in 3.3
- From: James Colhoun <ColhounJ@cardiff.ac.uk>
- Date: Tue, 29 May 2012 12:18:55 +0100
Hi,
I am uploading publications via sword, full text files are added to the upload xml and encoded in base64 this worked fine until we upgraded to 3.3. Now we get errors in the log:
failed: expected 3151 bytes but actually got 3149 bytes
So it seems the decoding of base64 is no longer working correctly. Inside EPrints/DataObj/File.pm the functions: end_element, characters and start_element seems to create a tmp file that is corrupt. If I add a write to file inside "sub characters" (see below) the pdf is created correctly so I know the data is passed in correctly, there seems to be something fundamentally broken with the way the decoding to tmpfile is working. Has anyone seen this are have a fix for it?
if( $state->{depth} == 2 && defined $state->{encoding} )
{
my $tmpfile = $epdata->{_content};
$state->{buffer} .= $data->{Data};
open (MYFILE, '>>/tmp/data2.pdf');
print MYFILE MIME::Base64::decode_base64($data->{Data});
close (MYFILE);
for($state->{buffer})
{
#print $tmpfile MIME::Base64::decode_base64( substr($_,0,length($_) - length($_)%77) );
$_ = substr($_,length($_) - length($_)%77);
}
}
- Follow-Ups:
- [EP-tech] Re: Base64 decoding in 3.3
- From: Tim Brody <tdb2@ecs.soton.ac.uk>
- [EP-tech] Re: Base64 decoding in 3.3
- Prev by Date: [EP-tech] Re: Where is views.xml in 3.3.10
- Next by Date: [EP-tech] Request 3.3.10 Debian Package
- Previous by thread: [EP-tech] Re: Where is views.xml in 3.3.10
- Next by thread: [EP-tech] Re: Base64 decoding in 3.3
- Index(es):