Skip to content

Commit

Permalink
fix: upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed May 5, 2024
1 parent 2d7ada5 commit e1dbba9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ImageQueryDto map(MultipartFile multipartFile, String query) {
} catch (Exception e) {
LOG.info("Mapping failed.", e);
}
return null;
return imageDto;
}

private ImageType toImageType(String contentType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class ImageQueryComponent {
if (!!this.imageForm.controls.file) {
this.result = null;
const formData = new FormData();
formData.append('file', (this.imageForm.controls.file as unknown as Blob));
const myFile = this.imageForm.controls.file.value;
formData.append('file', myFile as Blob, myFile?.name as string);
formData.append('query', this.imageForm.controls.query.value as unknown as string);
formData.append('type', (this.imageForm.controls.file.value as unknown as File)?.type);
console.log(formData);
Expand Down

0 comments on commit e1dbba9

Please sign in to comment.