Merge branch 'thierry' of ssh://git.marbelium.com:10023/Viiciouss/Sup_File into anis
This commit is contained in:
commit
1fa02b42d8
5
app.js
5
app.js
@ -13,7 +13,7 @@ var app = express();
|
||||
//DB
|
||||
|
||||
//file
|
||||
var upload = require("express-fileupload")
|
||||
var upload = require("express-fileupload");
|
||||
//var morgan = require('morgan');
|
||||
var mongoose = require('mongoose');
|
||||
var passport = require('passport');
|
||||
@ -35,7 +35,8 @@ app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({'extended':'false'}));
|
||||
app.use(express.static(path.join(__dirname, 'dist')));
|
||||
//bizarrr
|
||||
app.use('/public',express.static(path.join(__dirname, '../public')));
|
||||
|
||||
app.use('/public',express.static(path.join(__dirname, './public')));
|
||||
app.use('/books', express.static(path.join(__dirname, 'dist')));
|
||||
app.use('/api', api);
|
||||
|
||||
|
@ -126,7 +126,7 @@ const storage = multer.diskStorage({
|
||||
});
|
||||
|
||||
//post qui va stocker la photo du user ajoute dans le register , multer permet de definir le dossier serveur dans lequel seront stockes les photos
|
||||
router.post('/upload' , multer({storage: storage}).array("public[]", 12) ,function(req,res,next){
|
||||
router.post('/upload' , multer({storage: storage, limits: {fileSize: 30000000000}}).array("public[]", 12) ,function(req,res,next){
|
||||
|
||||
console.log("req.files[0].fieldname: "+req.files[0].fieldname);//ok
|
||||
console.log("req.files[0].originalname: "+req.files[0].originalname);//ok
|
||||
|
@ -24,13 +24,30 @@
|
||||
<td>{{ file.name }}</td>
|
||||
<td>{{ file.taille / ( 1024 * 1024 ) | number : '1.2-2'}} Mo</td>
|
||||
<td>{{ file.extention }}</td>
|
||||
<td>{{ file.path }}</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>
|
||||
|
||||
<img src="../../../public/23460.jpg" class="img-fluid flex-center">
|
||||
|
||||
|
||||
<!--
|
||||
|
Loading…
Reference in New Issue
Block a user