質問編集履歴
2
なるべく試したことは残すよう、ソースを修正しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,6 +15,10 @@
|
|
15
15
|
const NEW_MAX_WIDTH = 600;
|
16
16
|
|
17
17
|
const NEW_MAX_HEIGHT = 600;
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
$success = true;
|
18
22
|
|
19
23
|
|
20
24
|
|
@@ -102,9 +106,15 @@
|
|
102
106
|
|
103
107
|
|
104
108
|
|
105
|
-
imagecopyresampled($new_image,$emp_img,0,0,0,0,$new_width,$new_height,$width,$height)
|
109
|
+
if( imagecopyresampled($new_image,$emp_img,0,0,0,0,$new_width,$new_height,$width,$height) ){
|
106
110
|
|
107
|
-
$save_image = $new_image['tmp_name'];
|
111
|
+
$save_image = $new_image['tmp_name'];
|
112
|
+
|
113
|
+
}else{
|
114
|
+
|
115
|
+
$success = false;
|
116
|
+
|
117
|
+
}
|
108
118
|
|
109
119
|
|
110
120
|
|
@@ -122,25 +132,33 @@
|
|
122
132
|
|
123
133
|
|
124
134
|
|
125
|
-
|
135
|
+
if($success){
|
126
136
|
|
127
|
-
$
|
137
|
+
$file_tmp = $save_image;
|
128
138
|
|
129
|
-
|
139
|
+
$savefile_name = "testimg" . date("YmdHis") . $extension;
|
130
140
|
|
131
|
-
|
141
|
+
|
132
142
|
|
133
|
-
|
143
|
+
// アップロードディレクトリ指定
|
134
144
|
|
135
|
-
|
145
|
+
$file_save = "../" . SAVE_FOLDER_PATH . $savefile_name;
|
136
146
|
|
137
|
-
|
147
|
+
|
138
148
|
|
149
|
+
// アップロード処理
|
150
|
+
|
139
|
-
move_uploaded_file($file_tmp, $file_save)
|
151
|
+
if( !(move_uploaded_file($file_tmp, $file_save)) ){
|
152
|
+
|
153
|
+
$success = false;
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
}
|
140
158
|
|
141
159
|
}
|
142
160
|
|
143
|
-
e
|
161
|
+
echo $success;
|
144
162
|
|
145
163
|
?>
|
146
164
|
|
1
例示ドメインの修正致しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<?php
|
10
10
|
|
11
|
-
const SERVER_URL = "https://ex
|
11
|
+
const SERVER_URL = "https://example.com/";
|
12
12
|
|
13
13
|
const SAVE_FOLDER_PATH = "image/";
|
14
14
|
|