';
if (isset($_POST['submit'])) {
$url = sprintf('https://api.anonfiles.com/upload?token='.$apikey);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => curl_file_create(
$_FILES['file']['tmp_name'],
$_FILES['file']['type'],
$_FILES['file']['name']
),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$json = curl_exec($ch);
curl_close($ch);
$result = json_decode($json);
if (is_object($result) && $result->status) {
echo '
';
} else {
echo '
Fehler beim Hochladen der Datei.
';
}
}
?>