<?php

$MAXIMUM_FILESIZE = 1024 * 1000;

//get current album directory
$album_dir = strip_tags($_POST['albumDir']);

foreach ($_FILES as $fieldName => $file) {
	if($file['size'] > $MAXIMUM_FILESIZE) {
		echo 100;
		exit;	
	}
	
	$timestamp = time();
    $myFileExt = $timestamp."_".$file['name'];
	$myTempFile = $album_dir.$myFileExt;
	if( @move_uploaded_file($file['tmp_name'], $myTempFile) ) {
		echo $myFileExt;
	}
	else 
	    echo 102;
}
?>



