-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiletypetest.js
More file actions
21 lines (19 loc) · 783 Bytes
/
Copy pathfiletypetest.js
File metadata and controls
21 lines (19 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// var mmm = require('mmmagic'),
// Magic = mmm.Magic;
// var magic = new Magic(mmm.MAGIC_MIME_TYPE);
// magic.detectFile('.tmp/uploads/M7hGzPP', function(err, result) {
// if (err) throw err;
// console.log(result);
// // output on Windows with 32-bit node:
// // application/x-dosexec
// });
var path = require('path');
var filePath = "/home/dave/Desktop/Projects/nodeimghost/.tmp/uploads/tmp/ob$KDhXS.jpg"
var dir = path.dirname(filePath)
console.log(dir)
// + user can supply URL to remote image to download
// + user registeration/login (so they can view/upload/delete images to their account)
// * Ensure file type (read headers?)
// tmpdir and move to acdir when validated
// move to config type system
// npm install sails-generate-auth