• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 3 + Dropzone

#1
I'm trying to create an image upload with Dropzone, every time I attach an image, I get POST 200 and I think everything is fine but the image has not been uploaded.

I can not make it work, can someone help me?

Thanks!!!!



Controller:

Code:
 public function test(){

        $config['upload_path']   = './uploads/';

        $config['allowed_types'] = 'gif|jpg|png';

        $config['max_size']      = 1024;


        $this->load->library('upload', $config);

        $this->upload->do_upload('file');
}

View:
Code:
    <link href='https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.css' type='text/css' rel='stylesheet'>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.js' type='text/javascript'></script>
   
    <script>
    Dropzone.options.fileupload = {
      acceptedFiles: 'image/*',
      url: '<?= base_url('admin/galeria/test') ?>',
      maxFilesize: 2
    };
    </script>

       <?php echo form_open_multipart('admin/galeria/test', array('class' => 'dropzone', 'id' => 'fileupload')) ; ?>
      </form>
Reply


Messages In This Thread
CI 3 + Dropzone - by Camp1 - 01-10-2019, 11:41 AM
RE: CI 3 + Dropzone - by alexmocanu - 01-11-2019, 04:19 AM
RE: CI 3 + Dropzone - by php_rocs - 01-11-2019, 07:21 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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