Skip to content
Snippets Groups Projects
Commit 29428b8e authored by Puguh Wijayanto's avatar Puguh Wijayanto
Browse files

GeniXCMS v0.0.4

Backend Improvement
Security Update
parent 7a52e0b5
No related branches found
No related tags found
No related merge requests found
<?php
/*
* Name: TestImage CLass
* Desc: TestImage CLass description
* Version: 0.0.1
* Build: 0.0.1 pre
* Developer: Puguh Wijayanto
* URI: http://www.metalgenix.com
* License: MIT License
* Icon: <i class="fa fa-cogs"></i>
*/
\ No newline at end of file
<?php
if( isset($_POST['upload']) ){
//echo "string";
//print_r($_FILES);
if(isset($_FILES['images']) && $_FILES['images'] != ''){
$path = "/assets/images/uploads/";
$allowed = array('png', 'jpg', 'gif');
$upload = Upload::go('images', $path, $allowed );
if(isset($upload['error']) != ''){
echo $upload['error'];
}else{
$im = $upload['filepath'];
$dst = GX_PATH."/assets/images/uploads/thumbs/".$upload['filename'];
Image::resize($im, $dst, "300", '300', 1);
list($w, $h) = getimagesize($im);
Image::resize($im, $im, $w, $h, 0);
}
}
echo "<pre>";
print_r($upload);
echo "</pre>";
}
?>
<div class="row">
<div class="col-md-12">
<h1>GeniXCMS TestImage Sample</h1>
<hr />
</div>
<div class="col-md-12">
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="images" class="form-control">
<button type="submit" class="btn btn-primary" name="upload"><i class="fa fa-upload"></i> Upload</button>
</form>
</div>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment