File tree 1 file changed +2
-25
lines changed
1 file changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,8 @@ function save() {
101
101
}
102
102
}
103
103
104
- header ('Content-type: application/json; charset=utf-8 ' );
105
- echo json_encode ($ message );
106
-
107
- die ();
104
+ $ this ->response ->setType ('json ' );
105
+ $ this ->response ->output ($ message );
108
106
}
109
107
110
108
function loadFile () {
@@ -123,27 +121,6 @@ function loadFile() {
123
121
die ("Error loading: $ file " );
124
122
}
125
123
126
- function upload () {
127
- $ type = $ this ->request ->post ['type ' ];
128
- $ path = sanitizeFileName ($ this ->request ->post ['mediaPath ' ]);
129
- $ file = sanitizeFileName ($ this ->request ->files ['file ' ]['name ' ]);
130
- $ path = str_replace ('/media ' , '' , $ path );
131
-
132
- $ destination = DIR_MEDIA . $ path . '/ ' . $ file ;
133
-
134
- if (move_uploaded_file ($ this ->request ->files ['file ' ]['tmp_name ' ], $ destination )) {
135
- if (isset ($ this ->request ->post ['onlyFilename ' ])) {
136
- echo $ file ;
137
- } else {
138
- echo $ destination ;
139
- }
140
- } else {
141
- echo __ ('Error uploading file! ' );
142
- }
143
-
144
- die ();
145
- }
146
-
147
124
function scan () {
148
125
$ type = $ this ->request ->get ['type ' ] ?? 'public ' ;
149
126
$ scandir = $ this ->dirForType ($ type );
You can’t perform that action at this time.
0 commit comments