I have this in view.blade.php
{!!Form::open(['url'=>'/Path/somepath','method'=>'POST','files'=>true])!!}
<div>
<span>{!!Form::label('Photo','Your photo')!!}</span>
<span>{!! Form::file('Photo')!!}</span>
</div>
{!!Form::close()!!}
I have this in the controller method:
$destinationPath = 'Folder/Subfolder1/Subfolder2';
$extension = Input::file('Photo')->getClientOriginalExtension();
$size = Input::file('Photo')->getSize();
$mime = Input::file('Photo')->getMimeType();
$path = Input::file('Photo')->getRealPath();
$fileName=’ 3da0d12d6d8667963392a446262b1773JJ.jpg’;
$ufile=Input::file('Photo');
$ufile->move($destinationPath, $fileName);
$details=[$size,$mime,$path,$fileName,$ufile];
dd($details);
and the result is this:
array:5 [▼
0 => 7673
1 => "image/jpeg"
2 => "C:\wamp2\tmp\php984F.tmp"
3 => "3da0d12d6d8667963392a446262b1773JJ.jpg"
4 => UploadedFile {#29 ▼
-test: false
-originalName: "vali.jpg"
-mimeType: "image/jpeg"
-size: 7673
-error: 0
}
]
But when I look into C:\wamp2\tmp\ the file php984F.tmp is not there. My problem was that moving the file to another path was not working… it can’t be working since the uploading seems not to work in the first place.
So, what am I doing wrong ?
Folder/Subfolder1/Subfolder2and has777permission