So in BulletProof's documentation, I follow what I had to do and the image doesn't even get to "echo" phase #2.
https://github.com/samayo/bulletproof/blob/master/README.md
if (isset($_POST['post_blog_submit'])) {
$image = new Bulletproof\Image($_FILES);
$title = $filter->input("string", $_POST['title']);
$body = $filter->input("string", $_POST['body']);
$image->setName('test')
->setMime(array('jpg'))
->setLocation('/data/gallery', 777)
->setDimension(250, 250)
->setSize(100, 10000000);
if($image['bthumb']){
echo 'Phase #2';
if($image->upload()){
echo $image->getName(); // samayo
echo $image->getMime(); // gif
echo $image->getLocation(); // avatars
echo $image->getFullPath(); // avatars/samayo.gif
echo 'uploaded';
} else {
echo $image['error'];
}
}
echo $image['error'];
}
This is my PHP code, which does exactly what README.MD stated for me to do.
<form name="post_blog" method="post" enctype="multipart/form-data">
<label for="title">Blog Title</label>
<input class="form-control" type="text" name="title" placeholder="Blog Title" required /> <br/>
<label for="body">Blog Body</label>
<textarea class="form-control" name="body" placeholder="Place your text ..." required> </textarea> <br/>
<label for="bthumb">Blog Thumbnail</label>
<input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>
<input type="file" name="bthumb" /> <br/>
<div class="pull-right">
<input type="hidden" name="post_blog_submit" value="1" />
<input type="submit" class="btn btn-danger" value="Submit!" />
</div>
</form>
I don't know what is possibly wrong, the form part of it looks correct and the backend looks correct. But it isn't even detecting the input itself.