• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PNG upload

#1
Photo 
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
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, 01: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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.