mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
a099073fde
refs https://github.com/TryGhost/Toolbox/issues/114 - Files API is meant to be used for non-executable file uploads of all sorts - The files are stored and retrieved for download as-is
20 lines
441 B
JavaScript
20 lines
441 B
JavaScript
const storage = require('../../adapters/storage');
|
|
|
|
module.exports = {
|
|
docName: 'files',
|
|
upload: {
|
|
statusCode: 201,
|
|
permissions: false,
|
|
async query(frame) {
|
|
const filePath = await storage.getStorage('files').save({
|
|
name: frame.file.originalname,
|
|
path: frame.file.path
|
|
});
|
|
|
|
return {
|
|
filePath
|
|
};
|
|
}
|
|
}
|
|
};
|