feat: fixed file path
This commit is contained in:
parent
2a16bce7cf
commit
5a7be6e184
|
|
@ -43,9 +43,8 @@ export class MediaController {
|
|||
@GetOrgFromRequest() org: Organization,
|
||||
@UploadedFile() file: Express.Multer.File
|
||||
) {
|
||||
const uploadedFile = await this.storage.uploadFile(file);
|
||||
const filePath = uploadedFile.path.replace(process.env.UPLOAD_DIRECTORY, basename(process.env.UPLOAD_DIRECTORY));
|
||||
return this._mediaService.saveFile(org.id, uploadedFile.originalname, filePath);
|
||||
const uploadedFile = await this.storage.uploadFile(file);
|
||||
return this._mediaService.saveFile(org.id, uploadedFile.originalname, uploadedFile.path);
|
||||
}
|
||||
|
||||
@Post('/upload-simple')
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export class LocalStorage implements IUploadProvider {
|
|||
const publicPath = `${innerPath}/${randomName}${extname(
|
||||
file.originalname
|
||||
)}`;
|
||||
console.log(filePath);
|
||||
|
||||
// Logic to save the file to the filesystem goes here
|
||||
writeFileSync(filePath, file.buffer);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue