Forum

Thread tagged as: Question, Problem, Field-Types

Uploading PDF's

Hi, I have setup a Perch template with restricted filed types, one of which is PDF, but Perch won't accept a PDF upload

Here's my template, the perch tag in question has the id="guide"

<perch:before>
            <div id="main" class="right_main">
</perch:before>
<perch:every count="2">
                <div class="half ratings posts no_margin">
<perch:else />
                <div class="half ratings posts">
</perch:every>
                    <div class="blog_image guide" style="background: url(<perch:content type="image" id="image" label="Background" crop="true" width="1200" height="800" />);">
                        <div class="overlay"></div>

                        <div class="info">
                            <h3><perch:content type="text" id="city" label="City Name" title="true" /></h3>
                            <perch:categories id="country" label="Country" set="city-guide-countries" required="true" suppress="true" />

<perch:if exists="content">
                            <a class="button small" href="guide.php?guide=<perch:content id="slug" type="slug" for="city" />">Read More</a>
</perch:if>

<perch:if exists="guide">
                            <a class="button small" href="<perch:content type="file" id="guide" label="Guide Download" accept="pdf doc docx xls xlsx jpg jpeg" />" download><i class="fa fa-download"></i> Download Guide</a>
</perch:if>
                        </div>
                    </div>
                </div>

                <perch:content type="textarea" id="content" label="Content" editor="ckeditor" html="true" suppress="true" />
<perch:after>
<perch:if exists="paging">
                <div class="pagination">
                    <perch:if exists="not_first_page"><a id="prev" href="<perch:content id="prev_url" encode="false" />"><span>Prev</span></a></perch:if>

                    <span class="page_counter"><perch:content id="number_of_pages" /></span>

                    <perch:if exists="not_last_page"><a id="next" href="<perch:content id="next_url" encode="false" />"><span>Next</span></a></perch:if>
                </div>
</perch:if>
            </div>
</perch:after>

Here's my filetypes.ini file

[webimage]
image/gif
image/jpeg
image/jpg
image/png
image/svg+xml
image/webp

[image]
image/*

[pdf] 
application/pdf

[text]
application/plain
text/plain

[richtext]
application/rtf
application/x-rtf
text/richtext
text/rtf

[xml]
application/x-latex
application/xml
text/xml

[zip]
application/rar
application/x-bzip
application/x-bzip2
application/x-compressed
application/x-gzip
application/x-rar
application/x-rar-compressed
application/x-sit
application/x-stuffit
application/x-zip
application/x-zip-compressed
application/zip
multipart/x-gzip
multipart/x-zip
application/gnutar

[audio]
application/x-midi
audio/*

[video]
application/x-troff-msvideo
video/*

[flash]
application/x-shockwave-flash

[office] 
application/arj
application/excel
application/mspowerpoint
application/msword
application/onenote
application/powerpoint
application/vnd.ms-excel
application/vnd.ms-excel.addin.macroEnabled.12
application/vnd.ms-excel.sheet.binary.macroEnabled.12
application/vnd.ms-excel.sheet.macroEnabled.12
application/vnd.ms-excel.template.macroEnabled.12
application/vnd.ms-office
application/vnd.ms-officetheme
application/vnd.ms-powerpoint
application/vnd.ms-powerpoint.addin.macroEnabled.12
application/vnd.ms-powerpoint.presentation.macroEnabled.12
application/vnd.ms-powerpoint.slide.macroEnabled.12
application/vnd.ms-powerpoint.slideshow.macroEnabled.12
application/vnd.ms-powerpoint.template.macroEnabled.12
application/vnd.ms-word
application/vnd.ms-word.document.macroEnabled.12
application/vnd.ms-word.template.macroEnabled.12
application/vnd.oasis.opendocument.chart
application/vnd.oasis.opendocument.database
application/vnd.oasis.opendocument.formula
application/vnd.oasis.opendocument.graphics
application/vnd.oasis.opendocument.graphics-template
application/vnd.oasis.opendocument.image
application/vnd.oasis.opendocument.presentation
application/vnd.oasis.opendocument.presentation-template
application/vnd.oasis.opendocument.spreadsheet
application/vnd.oasis.opendocument.spreadsheet-template
application/vnd.oasis.opendocument.text
application/vnd.oasis.opendocument.text-master
application/vnd.oasis.opendocument.text-template
application/vnd.oasis.opendocument.text-web
application/vnd.openofficeorg.extension
application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.openxmlformats-officedocument.presentationml.slide
application/vnd.openxmlformats-officedocument.presentationml.slideshow
application/vnd.openxmlformats-officedocument.presentationml.template
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.openxmlformats-officedocument.spreadsheetml.template
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/vnd.openxmlformats-officedocument.wordprocessingml.template
application/wordperfect
application/x-excel
application/x-msexcel
David Henderson

David Henderson 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have the finfo extension installed on your server? It may be that the server isn't correctly detecting the file type.