Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function upload(Request $request)
- {
- //return "xxx";
- $CKEditor = $request->input('CKEditor');
- $funcNum = $request->input('CKEditorFuncNum');
- $message = $url = '';
- if (Input::hasFile('upload')) {
- //return "working";
- $file = Input::file('upload');
- if ($file->isValid()) {
- $filename = rand(1000, 9999) . $file->getClientOriginalName();
- $file->move(public_path() . '/wysiwyg/', $filename);
- $url = url('wysiwyg/' . $filename);
- } else {
- $message = 'An error occurred while uploading the file.';
- }
- } else {
- $message = 'No file uploaded.';
- }
- return '<script>window.parent.CKEDITOR.tools.callFunction(' . $funcNum . ', "' . $url . '", "' . $message . '")</script>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement