You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sup_File/src/app/book/book.component.html

65 lines
2.1 KiB
HTML

<div class="container-fluid">
<label class="btn btn-danger col-sm-2 col-md-2" >
Fichier à ajouter<input type="file" style="display: none;" #myPicture name="myPicture" (change)="fileChangeEvent($event)">
</label>
<button type="button" class="btn btn-warning" (click)="upload()">Ajouter le fichier {{fileChooseName}}</button>
<label> Vous avez choisi : {{fileChooseName}}</label>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Nom</th>
<th>Taille</th>
<th>Type</th>
<th>Date d'ajout</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let file of allUserFile; let i = index;">
<th scope="row">{{ i + 1 }}</th>
<td>{{ file.name }}</td>
<td>{{ file.taille / ( 1024 * 1024 ) | number : '1.2-2'}} Mo</td>
<td>{{ file.extention }}</td>
<td>{{ file.lastDate }}</td>
<div *ngIf="file.extention === ('image/jpeg')">
<img src="../../../{{ file.path }}" class="img-fluid flex-center" width="150" height="150">
</div>
<div *ngIf="file.extention === ('image/png')">
<img src="../../../{{ file.path }}" class="img-fluid flex-center" width="150" height="150">
</div>
<div *ngIf="file.extention === ('application/pdf')">
<i class="fa fa-file-pdf-o" aria-hidden="true"></i>
</div>
<div *ngIf="file.extention === ('video/mp4')">
<i class="fa fa-file-movie-o" aria-hidden="true"></i>
</div>
<div *ngIf="file.extention === ('text/plain')">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
</div>
<div *ngIf="file.extention === ('audio/mpeg')">
<i class="fa fa-file-audio-o" aria-hidden="true"></i>
</div>
</tr>
</tbody>
</table>
<!--
<form enctype="multipart/form-data" method="post" name="fileinfo">
<label>Fichier à mettre de côté :</label>
<input type="file" name="file" (change)="fileChangeEvent($event)" required />
<input type="submit" (click)="upload2()" value="Mettez le fichier de côté." />
</form>
<div></div>
-->