Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Last active December 20, 2015 14:39
Show Gist options
  • Save anthonycvella/6148729 to your computer and use it in GitHub Desktop.
Save anthonycvella/6148729 to your computer and use it in GitHub Desktop.
2013-08-03 21:49:25.636 Runway Management System[3482:c07] response: [Array
(
[file] => Array
(
[name] => nMjas8cmdRz8USe1js1Y.jpeg
[type] => image/jpeg
[tmp_name] => /Applications/XAMPP/xamppfiles/temp/phpQ2bf8A
[error] => 0
[size] => 20471
)
)
Array
(
[file] => Array
(
[name] => nMjas8cmdRz8USe1js1Y.jpeg
[type] => image/jpeg
[tmp_name] => /Applications/XAMPP/xamppfiles/temp/phpQ2bf8A
[error] => 0
[size] => 20471
)
)
<br />
<b>Notice</b>: Undefined variable: name in <b>/Applications/XAMPP/xamppfiles/htdocs/RMS/api.php</b> on line <b>75</b><br />
]
function upload()
{
global $db;
print_r($_FILES);
$signID = isset( $_POST['signID'] ) ? $_POST['signID'] : false ;
$uploaddir = 'uploads/';
$file = basename($_FILES['file']['name']);
$uploadfile = $uploaddir . $file;
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
print_r($_FILES);
$db->query("UPDATE signs SET `imagePath` = ? WHERE `signId` = ?")->bind(1, $name)->bind(2, $signID)->execute();
return true;
}
//http_response_code(403);
//sendResponse(403, 'Upload Failed');
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment