Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF is upload with application/octet-stream
    primarykey
    data
    text
    <p>I have an Upload in my Application, where the User can upload PDF, PNG, JPG and GIF Files with a maximum file size of 2MB. When i upload a PDF with a larger size of 2MB i get the error <code>File has an incorrect mimetype of 'application/octet-stream'</code></p> <p>Here you can see my Filters an Validators:</p> <pre><code> 'type' =&gt; 'Zend\InputFilter\FileInput', 'name' =&gt; $name, 'required' =&gt; $required, 'filters' =&gt; array( array( 'name' =&gt; '\Application\Filter\File\RenameUpload', 'options' =&gt; array( 'target' =&gt; 'data/upload', 'use_upload_name' =&gt; true, 'count_up' =&gt; true, ), ), ), 'validators' =&gt; array( array('name' =&gt; '\Zend\Validator\File\UploadFile'), array( 'name' =&gt; '\Zend\Validator\File\Extension', 'options' =&gt; array( 'extension' =&gt; array( 'pdf', 'jpg', 'jpeg', 'png', 'gif', ), ), ), array( 'name' =&gt; 'Zend\Validator\File\Size', 'options' =&gt; array( 'max' =&gt; '2MB', 'min' =&gt; '1KB', ), ), array( 'name' =&gt; '\Zend\Validator\File\MimeType', 'options' =&gt; array( 'mimeType' =&gt; array( 'application/pdf', 'image/jpg', 'image/jpeg', 'image/png', 'image/gif', ), ), ), ), </code></pre> <p>The <code>RenameUpload</code> is an own Filter, which checks if a file with the same name already exists and renames it, by adding a underscore with a Number.</p> <p>When i add the 'application/octet-stream' MimeType to my Array the Upload works (with the problem, the file will be two times copied to my target directory)</p> <p>Anyone an idea how i can fix the problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload