質問編集履歴
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,19 +22,19 @@
|
|
22
22
|
|
23
23
|
/********controller保存該当部分*************/
|
24
24
|
|
25
|
-
|
25
|
+
//画像ファイル名
|
26
26
|
|
27
|
-
|
27
|
+
$data ['Image'] ['imagefile_name'] = $data ['Image'] ['imagefile'] ['name'];
|
28
28
|
|
29
|
-
|
29
|
+
$data ['Image'] ['filetype'] = $data['Image']['imagefile']['type'];
|
30
30
|
|
31
|
-
|
31
|
+
//画像ファイルデータ
|
32
32
|
|
33
|
-
|
33
|
+
$data ['Image'] ['imagefile'] = file_get_contents( $data ['Image'] ['imagefile'] ['tmp_name'] );
|
34
34
|
|
35
|
-
|
35
|
+
// 保存
|
36
36
|
|
37
|
-
|
37
|
+
if ( $this->Image->save ( $data )) {
|
38
38
|
|
39
39
|
|
40
40
|
|
1
ご指摘いただきありがとうございます。コード修正しました。\$image\['Image'\]\['filetype'\] はとれています("image/jpeg"が入っていました。)。
test
CHANGED
File without changes
|
test
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
|
18
18
|
|
19
19
|
###該当のソースコード
|
20
|
+
|
21
|
+
```php
|
20
22
|
|
21
23
|
/********controller保存該当部分*************/
|
22
24
|
|
@@ -63,3 +65,5 @@
|
|
63
65
|
/********ctp出力該当部分*************/
|
64
66
|
|
65
67
|
<?php echo $this->Html->image( "/Images/contents/" . $imagefile_name);?>
|
68
|
+
|
69
|
+
```
|