aaa--------追加分lsal.html<html><head><title>lsal.html</title></head><body><form method="post" enctype="multipart/form-data" action="lscgi01.cgi">updir(Remote):<input type="text" name="updir"><BR><input type="submit" value="送信"></form></body></html>--------<html><head><title>up.html</title></head><body><form method="post" enctype="multipart/form-data" action="up.php">updir(Remote):<input type="text" name="updir"><BR>localdir(Localdir):<input type="text" name="localdir"><BR>upfile:<input type="file" name="upfile"><BR>Mode(例:0700):<input type="text" name="filemode"><BR><input type="submit" value="アップロードする"></form></body></html><html><head><title>up.php</title></head><body><p> file uploader </p><?php// $updir = "./upload/";
$updir = $_POST['updir'];
$filename = $_FILES['upfile']['name'];
$filemode = $_POST['filemode'];
print("updir:");print("$updir </br>");
print("filename:");print("$filename </br>");
print("filemode:");print("$filemode </br>");
if (move_uploaded_file($_FILES['upfile']['tmp_name'], $updir.$filename) == FALSE){ print("Upload failed"); print($_FILES['upfile']['error']);}else { print("<b> $filename </b> uploaded");
// print("<b> $filemode </b> change moded");
// chmod("/somedir/somefile", 0755); // 8 進数; 正しいモードの値
if (chmod($updir.$filename, $filemode ) == FALSE){ print("chmod failed"); } else { print("<b> $filemode </b> change moded"); }
}?></body></html>aaa
このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー と 利用規約 が適用されます。
1文字以上入力してください
本文は少なくとも1文字以上必要です。
1文字以上入力してください。