Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB