Welcome Guest, Not a member yet? Register   Sign In
PNG upload
#1
Photo 
(This post was last modified: 06-17-2017, 03:12 AM by Midhun Mohanan P.)

Hi,

Attempting to upload a PNG picture(in the image link) and it is not allowing it to upload. I am able to upload other PNG images.
I can't upload picture in codeigniter forum attachment .

Image link : https://drive.google.com/open?id=0Bz2laj...FNrN1RzWXc

This is my image upload code.

PHP Code:
$config['upload_path'] = FCPATH.'public/images/pins/';
 
$config['allowed_types'] = 'png|gif|jpg|jpeg';

 
$this->load->library('upload'$config);
 if (! 
$this->upload->do_upload("file")) {
 echo 
"invalid";
 
//echo json_encode($FILES['file']['type']);
 
}
 else
 {
 
$image=$this->upload->data();
 
$image_name=$image['file_name'];
 echo 
json_encode($image_name);
 } 
Practice | Practice | Practice
Reply
#2

(This post was last modified: 06-17-2017, 12:06 AM by Diederik.)

How do you expect help from the community with so little information? Please provide us with more details, codes and the things you already tried to debug your issue.
Reply
#3

(06-17-2017, 12:05 AM)Diederik Wrote: How do you expect help from the community with so little information? Please provide us with more details, codes and the things you already tried to debug your issue.

Sorry .I have added my code to the topic.
Practice | Practice | Practice
Reply
#4

If you can upload other PNG images, then the PNG that is failing might have the PNG extension, but the file mime type does not match that of a PNG image.

CodeIgniter not only checks if a file extension is correct, but it also checks the if the mime type of the file is correct.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB