Closed ghost closed 7 years ago
Thanks for your feedback. I guess the problem is the missing content type. What browser are you using and what image file type?
Chrome. Image is jpeg. Where do i specify content type? as attribute?
Unfortunately I'm not able to re-produce your issue. It is true, that the gallery app is ignoring the file extension. But I don't think this is a big issue.
It's possible that your browser doesn't show the image correctly because of a missing/wrong Content-Type
when loading the image from S3.
Could you please try to change the following part in chapter7/gallery/server.js
and upload a new photo afterwards?
Old
var params = {
Body: image,
Bucket: bucket,
Key: uuid.v4(),
ACL: "public-read",
ContentLength: image.byteCount
};
New
var params = {
Body: image,
Bucket: bucket,
Key: uuid.v4(),
ACL: "public-read",
ContentLength: image.byteCount,
ContentType: image.headers["content-type"]
};
Not sure if it's my config or something else. It strips off file extension upon upload. Then image is blank on the page