Skip to content

Instantly share code, notes, and snippets.

@twinge
Forked from ryanstrandt/gist:21531
Created November 1, 2008 15:01
Show Gist options
  • Save twinge/21533 to your computer and use it in GitHub Desktop.
Save twinge/21533 to your computer and use it in GitHub Desktop.
<?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");
if (isset($_FILES["Filedata"])) {
echo $_FILES["Filedata"]["error"];
}
exit(0);
}
if (isset($_FILES["Filedata"]) && is_uploaded_file($_FILES["Filedata"]["tmp_name"]) {
move_uploaded_file ( $_FILES["Filedata"]["tmp_name"] , '/var/www/public_domain/indycc.org/' . $_POST['target_directory'] )
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>SWFUpload v2.0 Multi-Upload Demo</title>
</head>
<body>
<p>Upload Page</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment