Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created May 27, 2013 10:19
Show Gist options
  • Save ScullWM/5656354 to your computer and use it in GitHub Desktop.
Save ScullWM/5656354 to your computer and use it in GitHub Desktop.
<?php
if(isset($_FILES['fileform']) && !empty($_FILES['fileform']) && $_FILES['fileform']['error']!=4):
$uniqidname = uniqid('pub_');
$directory = 'static/upload/'.rand(0,9).'/';
$ObjFichier = new upload($_FILES['fileform']);
$ObjFichier->TypesValides = array('image/jpeg','image/png','image/gif');
$ObjFichier->NewNom = $uniqidname;
$t = $ObjFichier->UploadFichier($directory) or die($ObjFichier->UploadErreur());
$pub->urlimg = $t;
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment