Fix possible error if HackMD is started with wrong workdir

In https://github.com/hackmdio/hackmd/issues/834 is described how
starting HackMD crashes when using the wrong working dir.

This is caused by a relative path in our upload routine. This change
should fix it and prevent future crashes.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
Sheogorath 2018-06-23 21:47:22 +02:00
parent 8fe26988d1
commit a2608c319a
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD
4 changed files with 4 additions and 1 deletions

View file

@ -16,7 +16,7 @@ imageRouter.post('/uploadimage', function (req, res) {
form.keepExtensions = true
if (config.imageUploadType === 'filesystem') {
form.uploadDir = 'public/uploads'
form.uploadDir = config.uploadsPath
}
form.parse(req, function (err, fields, files) {