Класс изображений BulletProof вообще не загружается

Таким образом, в документации BulletProof я следую тому, что я должен был сделать, и изображение даже не доходит до «эхо» фазы # 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'];
}

Это мой PHP-код, который делает именно то, что мне сказал README.MD.

 <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>

Я не знаю, что, возможно, не так, его форма выглядит правильно, а бэкэнд выглядит правильно. Но он даже не обнаруживает сам вход.

2

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector