feat: add file path
This commit is contained in:
parent
e8475929a8
commit
4c60b7794b
|
|
@ -35,7 +35,10 @@ export class MediaController {
|
|||
)
|
||||
file: Express.Multer.File
|
||||
) {
|
||||
const filePath = file.path.replace(process.env.UPLOAD_DIRECTORY, '');
|
||||
const filePath =
|
||||
file.path.indexOf('http') === 0
|
||||
? file.path
|
||||
: file.path.replace(process.env.UPLOAD_DIRECTORY, '');
|
||||
return this._mediaService.saveFile(org.id, file.originalname, filePath);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ const storage =
|
|||
process.env.CLOUDFLARE_ACCOUNT_ID &&
|
||||
process.env.CLOUDFLARE_ACCESS_KEY &&
|
||||
process.env.CLOUDFLARE_SECRET_ACCESS_KEY &&
|
||||
process.env.CLOUDFLARE_BUCKETNAME &&
|
||||
process.env.CLOUDFLARE_REGION &&
|
||||
process.env.CLOUDFLARE_BUCKETNAME &&
|
||||
process.env.CLOUDFLARE_BUCKET_URL
|
||||
? new CloudflareStorage(
|
||||
process.env.CLOUDFLARE_ACCOUNT_ID,
|
||||
|
|
|
|||
Loading…
Reference in New Issue