File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -121,5 +121,29 @@ public function updateBlock($data)
121
121
122
122
}
123
123
124
+ /**
125
+ * @param $data
126
+ */
127
+ public function createMedia ($ data )
128
+ {
129
+ $ fileName = $ data ['fileName ' ];
130
+ $ file = base64_decode ($ data ['file ' ]);
131
+ $ filePath = Mage::getBaseDir ('media ' ) . DS . $ fileName ;
132
+
133
+ if (! file_exists ($ filePath )){
134
+
135
+ try {
136
+
137
+ file_put_contents ($ filePath , $ file );
138
+ }catch (Exception $ e ){
139
+ Mage::logException ($ e );
140
+ }
141
+
142
+ }
143
+
144
+ Mage::log ($ fileName );
145
+ }
146
+
147
+
124
148
125
149
}
Original file line number Diff line number Diff line change 32
32
<title >Update Block</title >
33
33
<method >updateBlock</method >
34
34
</block_update >
35
+ <block_media translate =" title" module =" calindiacon_cmssync" >
36
+ <title >Update Media file</title >
37
+ <method >createMedia</method >
38
+ </block_media >
35
39
<info translate =" title" module =" calindiacon_cmssync" >
36
40
<title >Retrieve cutomers data with addresses</title >
37
41
<method >info</method >
You can’t perform that action at this time.
0 commit comments