Skip to content

Instantly share code, notes, and snippets.

View ryanstrandt's full-sized avatar

Ryan Strandt ryanstrandt

  • Eli Lilly
  • Indianapolis, IN
View GitHub Profile
<?php
if (isset($_POST["PHPSESSID"])) {
session_id($_POST["PHPSESSID"]);
}
session_start();
if (!isset($_FILES["Filedata"]) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) {
// Usually we'll only get an invalid upload if our PHP.INI upload sizes are smaller than the size of the file we allowed
// to be uploaded.
header("HTTP/1.1 500 File Upload Error");