Welcome Guest, Not a member yet? Register   Sign In
Correct MIME-typ to upload a `.gpx`- File?
#1

I would like to upload a .gpx-file (a GPS data file saved in the GPS Exchange format) in CodeIgniter 4. Using validation rules for an image file as a template (see below), I failed to modify it, so that the .gpx upload would work. Can somebody help me?

        $validationRule = [
            'userfile' => [
                'label' => 'Image File',
                'rules' => 'uploaded[userfile]'
                    . '|is_image[userfile]'
                    . '|mime_in[userfile,image/jpg,image/jpeg,image/gif,image/png,image/webp]'
                    . '|max_size[userfile,100]'
                    . '|max_dims[userfile,1024,768]',
            ],
        ];
       
Thanks!
Reply
#2

You will also need to add the mime type to app/Config/Mimies.php
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB