Add files via upload

pull/3/head
to3k 2022-11-29 13:53:57 +01:00 zatwierdzone przez GitHub
rodzic c0553bdcd3
commit 042377d0d5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 24 dodań i 0 usunięć

24
download.php 100644
Wyświetl plik

@ -0,0 +1,24 @@
<?php
$filename = 'Twittodon_com_db.csv';
$export_data = unserialize($_POST['export_data']);
// file creation
$file = fopen($filename,"w");
foreach ($export_data as $line){
fputcsv($file,$line);
}
fclose($file);
// download
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Type: application/csv; ");
readfile($filename);
// deleting file
unlink($filename);
exit();
?>