Skip to content

Instantly share code, notes, and snippets.

Created September 11, 2017 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c7017ba346488eb3163fc2c725108fac to your computer and use it in GitHub Desktop.
Save anonymous/c7017ba346488eb3163fc2c725108fac to your computer and use it in GitHub Desktop.
<?php
require_once("class/Upload.php");
// WAIT FOR FORM TO BE SUBMITED
if (isset($_FILES['file'])) {
$allowedFile = array("jpg","png");
// call the Upload class and upload file
$upload = new Upload($_FILES['file'],"images/",1000000,$allowedFile);
// show results
$result = $upload->GetResult();
print "<pre>";
print_r($result);
print "</pre>";
}
?>
<form action="index.php" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment