Open Ajinkya1496 opened 4 years ago
Hello,
I am using this text editor in my Angular 8 project. I am trying to upload image on my server and returning imageUrl in respone.
imageUrl
uploadUrl: 'http://localhost:3000/v1/image'
With the help of interceptors I generate a file with random string and return that same file.
@UseInterceptors(FileInterceptor('content_images', { storage: diskStorage({ destination: 'src/assets/content_images', filename: (req, file, callback) => { const randomName = generateImageName(); return callback(null, `${randomName}${extname(file.originalname)}`) } }) })) @Post('v1/image') async uploadContentImage(@Req() req: Request, @UploadedFile() file) { console.log(ENV.domain+file.path) return { imageUrl: ENV.domain+file.path } }
In the console at frontend side I get below error
Can someone help me with this?
Thanks, Ajinkya
Hi @Ajinkya1496 , Have you resolved this?
Not yet! I still have my apis as mentioned above but no luck so far in making it work!
Hello,
I am using this text editor in my Angular 8 project. I am trying to upload image on my server and returning
imageUrl
in respone.uploadUrl: 'http://localhost:3000/v1/image'
With the help of interceptors I generate a file with random string and return that same file.
In the console at frontend side I get below error
Can someone help me with this?
Thanks, Ajinkya