[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">
<input type="file" name="file">
</div>
<button type="submit" class="btn btn-primary btn-large">Send!</button>
</form>
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?!