Skip to content

Commit d57d40d

Browse files
add size and contentType to file uploads
1 parent 44eb09d commit d57d40d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/actions/storage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ export const uploadFile = (dispatch, firebase, config) => {
9999
})
100100
return { uploadTaskSnaphot }
101101
}
102-
const { metadata: { name, fullPath, downloadURLs } } = uploadTaskSnaphot
102+
103+
const {
104+
metadata: { name, fullPath, downloadURLs, size, contentType }
105+
} = uploadTaskSnaphot
103106
const { fileMetadataFactory } = firebase._.config
104107

105108
// Apply fileMetadataFactory if it exists in config
@@ -109,6 +112,8 @@ export const uploadFile = (dispatch, firebase, config) => {
109112
name,
110113
fullPath,
111114
downloadURL: downloadURLs[0],
115+
size,
116+
contentType,
112117
createdAt: firebase.database.ServerValue.TIMESTAMP
113118
}
114119

0 commit comments

Comments
 (0)