| Server IP : 80.211.21.168 / Your IP : 216.73.216.144 Web Server : Apache System : Linux alex-webdesign.it 3.10.0-1160.119.1.el7.tuxcare.els22.x86_64 #1 SMP Mon Aug 18 06:07:12 UTC 2025 x86_64 User : admin_japan ( 10003) PHP Version : 8.2.32 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/cerchijapan.it/ilpolonerd.it/ |
Upload File : |
#!/usr/bin/env php
<?php
// === CONFIGURAZIONE ===
const URL = 'https://ilpolonerd.it/danea/upload.php';
const USER = 'danea';
const PASS = 'Secret123';
// =======================
// 1) Creo un file vuoto (o con contenuto di test)
$filePath = __DIR__ . '/file.txt';
file_put_contents($filePath, "ciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaoneciaone"); // puoi mettere del testo qui se vuoi
// 2) Imposto cURL per inviare il file come body
$ch = curl_init(URL);
curl_setopt_array($ch, [
CURLOPT_USERPWD => USER . ':' . PASS,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => file_get_contents($filePath),
CURLOPT_HTTPHEADER => ['Content-Type: application/octet-stream'],
CURLOPT_RETURNTRANSFER => true,
]);
// 3) Eseguo e stampo risultato
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
fwrite(STDERR, "cURL Error: " . curl_error($ch) . "\n");
exit(1);
}
fwrite(STDOUT, "HTTP Status: {$httpCode}\n");
fwrite(STDOUT, "Response: {$response}\n");
curl_close($ch);