Skip to content

Instantly share code, notes, and snippets.

@tderick
Created September 13, 2022 04:04
Show Gist options
  • Save tderick/5d6a21f995506e936f36ea924602342c to your computer and use it in GitHub Desktop.
Save tderick/5d6a21f995506e936f36ea924602342c to your computer and use it in GitHub Desktop.
<html>
<head>
<title>List uploaded files</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body>
<table class="table">
<thead>
<tr>
<th scope="col">Filname</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
@foreach ($files as $file)
<tr>
<td>{{ $file->filename }}</td>
<td><a href="{{ route('downloadfile', $file->id) }}" class="btn-sm btn-primary">Download</a>
<form method="post" action="{{ route('deletefile', $file->id) }}" style="display:inline">
@method('delete')
@csrf
<button type='submit' class="btn btn-danger btn-sm">Delete</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>
<html>
<head>
<title>upload files</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body>
<form method="post" action="{{ route('fileuploads') }}" enctype="multipart/form-data">
@csrf
<div>
<input type="file" id="files" name="files[]" accept=".pdf" multiple
class="form-control form-control-lg">
</div><br><br>
<div>
<button class="btn btn-primary">Submit</button>
</div>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment