Skip to content

Instantly share code, notes, and snippets.

@tommymarshall
Created July 19, 2012 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommymarshall/3144321 to your computer and use it in GitHub Desktop.
Save tommymarshall/3144321 to your computer and use it in GitHub Desktop.
S3 example
public function put_files_new($id)
{
$filename = Input::file('file.name');
$temp_name = Input::file('file.tmp_name');
if ( S3::put_object($temp_name, 'laravel-test', $filename, S3::ACL_PUBLIC_READ) )
{
$new_file = array(
'name' => Input::get('name'),
'description' => Input::get('description'),
);
$file = new File($new_file);
$file->save();
}
return Redirect::to('projects/'. $project->id .'-'. $project->slug .'/files')
->with('message', 'Successfully uploaded!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment