質問編集履歴
2
yambejpさんの指摘を独自解釈して作成したphpのコードを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -125,3 +125,17 @@
|
|
125
125
|
|
126
126
|
|
127
127
|
※ちなみにxamppv3.2.2(Windows Ver)環境でローカルにテストサーバーを立ててPHP等使用しています。
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<追記 : yambejpさんの指摘を解釈したphpコード>
|
132
|
+
|
133
|
+
```PHP
|
134
|
+
|
135
|
+
if (is_uploaded_file($_FILES["up_file"]["tmp_name"])) {
|
136
|
+
|
137
|
+
if (move_uploaded_file ($_FILES["up_file"]["tmp_name"], "files/" .date("Ymd-His") . $_FILES["upfile"]["name"])) {
|
138
|
+
|
139
|
+
chmod("files/" . date("Ymd-His") . $_FILES["up_file"]["name"], 0644);
|
140
|
+
|
141
|
+
```
|
1
分かりやすいファイル名に記載内容を変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
<body>
|
32
32
|
|
33
|
-
<form method="post" action="
|
33
|
+
<form method="post" action="example.php" enctype="multipart/form-data">
|
34
34
|
|
35
35
|
ファイル:<input type="file" name="up_file" accept="image/*" /><br>
|
36
36
|
|