e107
e107 copied to clipboard
pdf upload problem
Bug Description
- we upload pdf files with upload.php While testing (with some other pdfs) it worked normally. But if failed with real pdf files.
The first problem was that error was about not supported the application/pdf type of file. I checked everything and I couldn't find any reason for this.
Then I got an idea to try upload that file with the import media manager option - error was Bad File Detected - it means that the same error is managed differently in media and upload handlers.
Because urgent of situation I commented that part in media manager and file was uploaded in MM. And then I knew that problem is not in file type but in checks in upload handler.
It failed on this test:
if(stripos($tstr, '<?xpacket') === false)
I had to remove this test to be able to upload those files. The urgent problem was fixed.
I tried to find what are those pdfs ... they are created by the combination of other pdf with program bulzip.
I reported this problem to our admins and their answer was that they checked their pdfs with
(https://www.pdflib.com/pdf-knowledge-base/xmp/free-xmp-validator/ )
and they were validated without any problem.
Can you explain to me why that code is there? Thanks
In order to fix I would need those PDFs to be opened in a text editor and the first few lines to be shared here.
Thank you. Those are the first lines:
%PDF-1.5
%Çì¢
5 0 obj
<</Length 6 0 R/Filter /FlateDecode>>
stream
xœÍ[]s·}節ÓÎtÝÆ›Å76Oµ%Ú–#K¶È$ÓIú@K”Ę"’²›<õô7÷â+´¸agš<Z.€‹s..°¿¢¦Æ¨Ñÿ»ÏoßœItµü: DÐK$•hê†#ÒQ+Ä$[NÑjŠ~D‹Á¯ð\Šš)SŸ)R+…áªÆªrV·ÂÂ*t¸¼‡ÿ¿9ÃÐÒz€Ñú
but problematic lines are later cca line 2500
43 0 obj
<</Type/Metadata
/Subtype/XML/Length 1499>>stream
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<?adobe-xap-filters esc="CRLF"?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
<rdf:Description rdf:about='uuid:19942fb6-2425-11ec-0000-f4a22d69bb97' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='PDF Printer / www.bullzip.com / FG / Freeware Edition (max 10 users)'/>
<rdf:Description rdf:about='uuid:19942fb6-2425-11ec-0000-f4a22d69bb97' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2021-09-30T10:37:09+02:00</xmp:ModifyDate>
<xmp:CreateDate>2021-09-30T10:37:09+02:00</xmp:CreateDate>
<xmp:CreatorTool>PDF Presentation Adobe Photoshop CC 2015</xmp:CreatorTool></rdf:Description>
<rdf:Description rdf:about='uuid:19942fb6-2425-11ec-0000-f4a22d69bb97' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:19942fb6-2425-11ec-0000-f4a22d69bb97'/>
<rdf:Description rdf:about='uuid:19942fb6-2425-11ec-0000-f4a22d69bb97' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>export_ŽiviÄ_Mirko.pdf</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>NVajdova</rdf:li></rdf:Seq></dc:creator></rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>
endstream
endobj
2 0 obj
<</Producer(\376\377\000P\000D\000F\000 \000P\000r\000i\000n\000t\000e\000r\000 \000/\000 \000w\000w\000w\000.\000b\000u\000l\000l\000z\000i\000p\000.\000c\000o\000m\000 \000/\000 \000F\000G\000 \000/\000 \000F\000r\000e\000e\000w\000a\000r\000e\000 \000E\000d\000i\000t\000i\000o\000n\000 \000\(\000m\000a\000x\000 \0001\0000\000 \000u\000s\000e\000r\000s\000\))
/CreationDate(D:20210930103709+02'00')
/ModDate(D:20210930103709+02'00')
/Creator(PDF Presentation Adobe Photoshop CC 2015)
/Title(\376\377\000e\000x\000p\000o\000r\000t\000_\001}\000i\000v\000i\001\r\000_\000M\000i\000r\000k\000o\000.\000p\000d\000f)
/Author(\376\377\000N\000V\000a\000j\000d\000o\000v\000a)>>endobj
xref
https://github.com/e107inc/e107/issues/4799
Closing. Re-open if necessary.