Created
April 3, 2020 02:20
-
-
Save thanhtungdp/166890c58292d82942165eab711341ed to your computer and use it in GitHub Desktop.
Upload Photo to Minio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const currentPrefix = "Giới thiệu/" //current folder | |
const fileName = "tung.jpg" | |
const prefix = path.join(currentPrefix, fileName) | |
const { data: { url }} = await api.get(`/s3/buckets/ilotusland/presigned-put-object?prefix=${prefix}`) | |
// `url` là API trả về, để từ Frontend PUT lên dữ liệu | |
const file = Object{} // file from select | |
api.put(url, file, { | |
headers: { | |
'Content-Type': file.type | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment