无法使用 curl 上传文件 (bash)

Can't upload files with curl (bash)

我尝试使用 curl 将文件上传到 this link,我的 curl 命令:

curl -F "upload=@/tmp/updater.log" http://galihpa.tk/upload.php

执行后,它给了我这个:

root@AngelBeats:~# curl -F "upload=@/tmp/updater.log" http://galihpa.tk/upload.php
<FORM method="post" name="upload" enctype='multipart/form-data'>
File : <input type="file" name="upload-file"><input type="submit" name="btnUploa
d" value="Upload">

这是我的upload.php

的完整代码
<?
    // untuk memindahkan file ke tempat uploadan
    $upload_path = "upload/";
    // handle aplikasi : apabila folder yang dimaksud tidak ada, maka akan dibuat
    if (!is_dir($upload_path)) {
        mkdir($upload_path);
    } 
    if (isset($_POST['btnUpload'])) { 
        $file = $_FILES['upload-file']['name'];
        $tmp  = $_FILES['upload-file']['tmp_name'];
        // jika $file ada dan tidak kosong
        if ((isset($file)) && ($file != "")) { 
            // handle apabila sudah ada file sama yang terupload, maka akan dibuat copynya
            $uploadfile = (file_exists($upload_path.$file)) ? $upload_path." copy of ".$file : $upload_path.$file;
            move_uploaded_file($tmp, $uploadfile);
            if (chmod($uploadfile, 0775)) {
                // tampilkan pesan sukses apabila berhasil mengupload file
                echo "Sukses mengupload file";
            } else {
                // tampilkan pesan gagal apabila tidak berhasil mengupload file
                echo "Gagal mengupload file";
            }
        }
    }
?>
<FORM method="post" name="upload" enctype='multipart/form-data'>
File : <input type="file" name="upload-file"><input type="submit" name="btnUpload" value="Upload">
</FORM>

请帮忙

您还需要填充 btnUpload 以触发您的处理代码,如:

curl -F "upload-file=@/tmp/updater.log" -F "btnUpload=Upload" http://galihpa.tk/upload.php