File upload 在dokuwiki中使用curl命令行上载文件

File upload 在dokuwiki中使用curl命令行上载文件,file-upload,curl,upload,dokuwiki,File Upload,Curl,Upload,Dokuwiki,我正试图找到一种方法来做到这一点。 到目前为止,由于cookie参数,我能够访问页面: curl -v --cookie cookies.txt --cookie-jar cookies.txt --user-agent Mozilla/4.0 --data "u=login&p=passwd" http://wiki/doku.php?id=start&do=login 然后 curl --cookie cookies.txt http://wiki/doku.php

我正试图找到一种方法来做到这一点。 到目前为止,由于cookie参数,我能够访问页面:

 curl -v --cookie cookies.txt --cookie-jar cookies.txt --user-agent Mozilla/4.0 --data "u=login&p=passwd" http://wiki/doku.php?id=start&do=login
然后

 curl --cookie  cookies.txt  http://wiki/doku.php?id=info
要上传文件,我需要在php页面上获取表单参数。我不知道我在找什么:

curl --form "file=@z.xml" --cookie cookies.txt "http://wiki/doku.php?id=start&tab_files=upload&do=media"

我让它以不同的方式工作。 我已经创建了一个upload.php文件()

最后,我在
httpd.conf


命令允许,拒绝
允许从192.168.1开始

<?php

$uploaddir = '/var/www/html/dokuwiki/upload/';
$uploadfile = $uploaddir . basename($_FILES['upload']['name']);

echo "<p>";

if (move_uploaded_file($_FILES['upload']['tmp_name'], $uploadfile)) {
  echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Upload failed";
}

echo "</p>";
echo '<pre>';
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";

?>
curl --form upload=@file --form press=OK http://wiki/upload/upload.php
<Directory "/var/www/html/dokuwiki/upload">
Order allow,deny
Allow from 192.168.1