Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
samayo authored Mar 24, 2017
1 parent fd9c3c7 commit ce6b03c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Usage
Create an HTML form like this.
```html
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"/>
<input type="file" name="pictures"/>
<input type="submit" value="upload"/>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"/>
<input type="file" name="pictures"/>
<input type="submit" value="upload"/>
</form>
```
And simply copy/paste the code below to upload images
Expand All @@ -36,13 +36,13 @@ require_once "path/to/bulletproof.php";
$image = new Bulletproof\Image($_FILES);

if($image["pictures"]){
$upload = $image->upload();
$upload = $image->upload();

if($upload){
echo $upload->getFullPath(); // uploads/cat.gif
}else{
echo $upload["error"];
}
if($upload){
echo $upload->getFullPath(); // uploads/cat.gif
}else{
echo $upload["error"];
}
}
```
That's all. For complete freedom of what, how and where to install, keep reading :)
Expand Down Expand Up @@ -107,12 +107,12 @@ $image->setName("samayo")
->setLocation("avatars");

if($image["pictures"]){
if($image->upload()){
echo $image->getName(); // samayo
echo $image->getMime(); // gif
echo $image->getLocation(); // avatars
echo $image->getFullPath(); // avatars/samayo.gif
}
if($image->upload()){
echo $image->getName(); // samayo
echo $image->getMime(); // gif
echo $image->getLocation(); // avatars
echo $image->getFullPath(); // avatars/samayo.gif
}
}
```

Expand Down Expand Up @@ -151,4 +151,4 @@ To create your own errors and responses, instead of the default error messages,
[utils]: https://github.com/samayo/bulletproof/tree/master/src/utils
[bulletproof_archive]: http://github.com/samayo/bulletproof/releases
[exif_imagetype_link]: http://php.net/manual/de/function.exif-imagetype.php
[getimagesize_link]: http://php.net/manual/en/function.getimagesize.php
[getimagesize_link]: http://php.net/manual/en/function.getimagesize.php

0 comments on commit ce6b03c

Please sign in to comment.