예제 #1
0
 /**
  * Store a newly created resource in storage.
  * POST /responses
  *
  * @return Response
  */
 public function store()
 {
     if (Input::hasFile('file')) {
         $name = Input::get('nam', time() . '.' . Input::file('file')->getClientOriginalExtension());
         $path = public_path() . '/downloads/' . Input::get('workorder_id') . '/';
         $this->fixPath($path);
         if (Input::file('file')->move($path, $name)) {
             $res = Responses::create(Input::except('name', 'file'));
             return Input::get('name');
         } else {
             return 'Unable to move file';
         }
     }
     return 'Some error has occured';
 }