• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image Upload without Upload Class

#1
[eluser]Unknown[/eluser]
Hello,

i'm trying to upload pictures to a third party service (cloudinary). I included the API sucessfully and now want to upload pictures from a form.

With cloudinary it works like this:

Code:
\Cloudinary\Uploader::upload($_FILES["file"]["tmp_name"]);


So what i need is the $_FILES["file"]["tmp_name"]. But my Form doesnt give it to me.

Form:
Code:
<form method="post" accept-charset="utf-8" acti site_url('/send_item'); ?" enctype="multipart/form-data"/>
      <div class="form-group">
        &lt;input type="file" name="file"&gt;
      </div>
      <button type="submit" class="btn btn-primary btn-large">Send!</button>
    &lt;/form&gt;

How to get the tmp_name?

var_dump($_FILES['file']); just gives me the name, no tmp_name (controller)

and

$this->input->post('file') just gives me the name, too. (controller)

So the Cloudinary Upload fails.

What can i do?


*EDIT*
If i use enctype="multipart/form-data" in my Form, $this->input->post('file') returns NULL. If not, it returns the name of the uploaded file?!


Messages In This Thread
Image Upload without Upload Class - by El Forum - 10-01-2013, 01:37 AM
Image Upload without Upload Class - by El Forum - 10-01-2013, 03:12 AM
Image Upload without Upload Class - by El Forum - 10-01-2013, 04:31 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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