2017 © Pedro Peláez
 

microphork-package package-uploads

A file uploader package for the microphork framework

image

microphork/package-uploads

A file uploader package for the microphork framework

  • Sunday, March 23, 2014
  • by elenor
  • Repository
  • 0 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Introduction

This is a file uploader package for the microphork framework. It validates and saves files uploaded via POST., (*1)

To extend this package create a \Phork\App\Uploads class in the app/classes folder., (*2)

Usage

//print a simple upload form
\Phork::output()->addContent('


'); //load and alias a new uploads package class_alias(\Phork::instance()->initPackage('Uploads'), 'PhorkUploads'); //if a file was uploaded then save it if (\Phork::router()->getMethod() == 'post' && $files = \PhorkUploads::getFiles()) { if (!empty($files['upload']) && $file = $files['upload']) { //uploaded $file['name'] to $file['tmp_name'] and move it to $output \PhorkUploads::saveFile($file['tmp_name'], $output = LOG_PATH.'upload.demo', true); } }

Credits

Built by Elenor at Phork Labs., (*3)

License

Licensed under The MIT License http://www.opensource.org/licenses/mit-license.php, (*4)

The Versions

23/03 2014

dev-master

9999999-dev

A file uploader package for the microphork framework

  Sources   Download

The Requires