Files Uploading on Amazon S3 server using Laravel 5.4 Part-2

Files Uploading on Amazon S3 server using Laravel 5.4 Part-2

In this Post We Will Explain About is Files Uploading on Amazon S3 server using Laravel 5.4 Part-2 With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Laravel 5 amazon s3 file upload Step By step Example

In this post we will show you Best way to implement php – Laravel 5.4:file upload to into aws s3 directly to bucket, hear for Uploading Directly To Amazon S3 From Laravel 5 Applicationwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

In this Second part I have last two step to make controller and crate blade view file for file simple upload file or video on amazon s3 server using Laravel 5 FileSystem.

Read Also:  How to Create a Wordpress Plugin in 10 Minutes Flat

In this Last second step, we shall use “Storage” Mode facade for all the upload file in simple amazon s3 server as well as also get CDN Mode url of uploaded All the files. Therefore Now follow simple bellow source code two step for full example finish of upload laravel using image upload in s3 server.

Step 5: Create Controller

In this last second point, now we need to make new controller as liveIMAGESs3Ctrl in this simple path app/Http/Controllers/liveIMAGESs3Ctrl.php. this view controller will manage all the layout and upload image validation with post data request, So run simple bellow command for success generate new controller:

php artisan make:controller liveIMAGESs3Ctrl

Ok, Ad then put bellow some content in controller file:

Following Path :app/Http/Controllers/liveIMAGESs3Ctrl.php

validate($request, [
            'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',

        $your_imgname = time().'.'.$request->image->getClientOriginalExtension();
        $image = $request->file('image');
        $t = Storage::disk('s3')->put($your_imgname, file_get_contents($image), 'public');
        $your_imgname = Storage::disk('s3')->url($your_imgname);

    	return back()
    		->with('success','Good Luck.!!Image Uploaded successfully.')

Step 6: Create View

	<title>step By step Laravel 5.3 Amazon S3 Image or video  Upload with Validation step by step  example</title>

<!-- Devloped by>
<div class="container">
  <div class="panel panel-primary">
    <div class="panel-heading"><h2>Laravel 5.3 Amazon S3 Image Upload with Validation example</h2></div>
<!-- Devloped by>
    <div class="panel-body">

      @if (count($errors) > 0)
	 <div class="alert alert-danger">
	    <strong>Whoops!</strong> There were some problems with your input.<br><br>
		  @foreach ($errors->all() as $error)
		    <li>{{ $error }}</li>
<!-- Devloped by>
	  @if ($data_message = Session::get('success'))
		<div class="alert alert-success alert-block">
			<button type="button" class="close">×</button>
		        <strong>{{ $data_message }}</strong>
		<img src="get('path') }}">
<!-- Devloped by>
	  <form action="{{ url('s3-image-upload') }}" enctype="multipart/form-data" method="POST">
		{{ csrf_field() }}
		<div class="row">
			<div class="col-sm-12">
			<div class="col-sm-12">
				<button type="submit" class="btn btn-success">File Upload</button>

<!-- Devloped by>

Now I Am ready to simple run your example therefor run bellow simple command ro all application quick run:

Read Also:  how to use checkbox in php?

php artisan serve

Now I can open this bellow URL on Mozila your browser:



I hope you have Got What is amazon s3 Server Uploading Files using Laravel 5.4 And how it works.I would Like to have FeadBack From My Blog( readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article( Are Most Always Welcome.