How to create view Laravel - File Uploading ?

Answers were Sorted based on User's Feedback



How to create view Laravel - File Uploading ?..

Answer / sunil kumar

Create a view file called resources/views/uploadfile.php and copy the following code in that file.
resources/views/uploadfile.php

Example :

<html>
<body>
<?php
echo Form::open(array('url' => '/uploadfile','files'=>'true'));
echo 'Select the file to upload.';
echo Form::file('image');
echo Form::submit('Upload File');
echo Form::close();
?>
</body>
</html>

Is This Answer Correct ?    0 Yes 0 No

How to create view Laravel - File Uploading ?..

Answer / Anoop Agarwal

To allow file uploading in a Laravel view, you should first create a form with an input of type 'file'. You can then use the `validate()` method in your controller to validate the uploaded file and store it in your database or filesystem as needed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

How facades are different from dependency injection?

1 Answers  


What is namespace in laravel?

1 Answers  


What are laravel facades?

1 Answers  


What is the purpose of using dd() function iin laravel?

1 Answers  


What is use keyword in laravel?

1 Answers  


Is valet supports windows or ubuntu environment?

1 Answers  


List out common artisan commands used in laravel.

1 Answers  


What is boot method in laravel?

1 Answers  


What is meant by Forms in Laravel ?

2 Answers  


What is http / console kernels in laravel?

1 Answers  


How to work with Database in Laravel ?

2 Answers  


Tell me what are the official packages provided by laravel?

1 Answers  


Categories