Created
March 22, 2017 11:49
-
-
Save samuelloza/f60493a406843998f22b22b18d8d93db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
En el controller | |
$destinationPath = 'uploads/imagenes'; | |
$extension = $request->file("image")->getClientOriginalExtension(); | |
$fileName = rand(11111,99999).'.'.$extension; | |
$request->file($type)->move($destinationPath, $fileName); | |
$uri = $destinationPath."/".$fileName; | |
En la vista para crear | |
El nombre del $request->file("image") --> image es el mismo que el de name="image" | |
La uri es la ruta donde se subio el archivo | |
<form action="{{route("admin.word.store")}}" method="POST" enctype="multipart/form-data" class="form-horizontal"> | |
<input type="hidden" name="_token" id="csrf-token" value="{{ Session::token()}}" /> | |
<input type="file" name="image" id="image" onchange="readURL(this);"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hummm para el momento de listar las imajenes como haces ?