function get_next_record($path) { // echo $path; $file = get_oldest_file($path); //echo "oldest".$file."\n"; $ret = file_get_contents($path . $file); //echo $path.$file; //echo $path.$file."\n"; unlink($path . $file); return $ret; //return $ret; }
} $max_size = 1024 * 80 * 1024; // the max. size for uploading $my_upload = new file_upload(); $my_upload->upload_dir = $_SERVER['DOCUMENT_ROOT'] . "/files/"; // "files" is the folder for the uploaded files (you have to create this folder) $my_upload->extensions = array(".png", ".zip", ".pdf", ".gif", ".bmp"); // specify the allowed extensions here if (isset($_POST['Submit'])) { $my_upload->the_temp_file = $_FILES['upload']['tmp_name']; $my_upload->the_file = $_FILES['upload']['name']; $my_upload->http_error = $_FILES['upload']['error']; $my_upload->replace = isset($_POST['replace']) ? $_POST['replace'] : "n"; $my_upload->do_filename_check = isset($_POST['check']) ? $_POST['check'] : "n"; if ($my_upload->upload()) { $latest = get_oldest_file($folder); del_file($folder . $latest); } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Demo: File upload/download and open directory</title> <style type="text/css"> <!-- body {