Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($request->hasFile('photo')){
- request()->validate([
- 'photo' => 'image|mimes:jpeg,png,jpg,gif,svg,tiff,tif,raw,bmp,psd',
- ]);
- $file = $request->file('photo');
- $name = $request->get('email')."-".$file->getClientOriginalName();
- // $file-> move($url,$name);
- $file->move(public_path().'/imageuser/', $name);
- }
- <form action="{{ route('CatelFoto.store') }}" method="POST" enctype=”multipart/form-data”>
- {!! csrf_field() !!}
- <input type="hidden" id="id" name="id" value="{{ $id }}" readonly="readonly">
- <p><h2><b>Subir Foto</b></h2></p>
- <div class="form-group {{ $errors->has('photo') ? 'has-error' : '' }}">
- <label form="photo">Foto: </label>
- <input class="form-control-file" type="file" name="photo" id="photo" value="{{ old('photo') }}" required><br>
- </div>
- <button class="btn btn-primary">Siguiente</button>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement