Commit ad03c540 authored by alexm98's avatar alexm98

Added JPEG support, fiddled a bit with the views.

parent c1dd7658
......@@ -31,6 +31,7 @@ class FileController extends Controller
'PS' => '25215053',
'WEBM' => '1A45DFA3',
'MP3' => 'FFFB',
'JPEG' => 'FFD8',
];
foreach($mimes as $key=>$value){
......@@ -48,12 +49,16 @@ class FileController extends Controller
'PS' => 'application/postscript',
'MP3' => 'audio/mpeg',
'WEBM' => 'video/webm',
'JPEG' => 'image/jpeg',
];
// error supressing @headers[$mimetype] because it might fatal err to undefined index
if(@$headers[$mimetype] != NULL){
header('Content-Type:'.$headers[$mimetype]);
}
// else{
// header('Content-Type: application/octet-stream');
// }
}
/**
......
This diff is collapsed.
body{
background: url('../background.jpg') !important;
background-size: cover;
background-repeat: no-repeat;
}
.upload{
border: 1px solid black;
background: white;
border-radius: 10px;
top: 20vh;
margin: 0 auto;
position: relative;
height: 20vh;
padding: 10px;
}
@extends('layouts.app')
@section('content')
<div class="col-md-5">
<h3>Upload a file</h3>
<div class="upload col-md-5">
<h3 class="text-center">Upload a file</h3>
<hr/>
<form method="POST" action="/files" enctype="multipart/form-data">
{{ csrf_field() }}
<br>
<input name="file" type="file"/>
<button type="submit" class="btn btn-success pull-right">Submit</button>
<button type="submit" class="btn btn-success float-right">Submit</button>
</form>
</div>
@stop
......@@ -5,11 +5,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<title>ipfs-mediashare</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('css/style.css') }}" rel="stylesheet" type="text/css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
......
......@@ -12,7 +12,8 @@
*/
Route::get('/', function () {
return view('welcome');
// return view('welcome');
return view('file.create');
});
Route::resource('/files', 'FileController');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment