【发布时间】:2018-11-04 13:24:03
【问题描述】:
CameraRoll.getPhotos(fetchParams) .then((data) => this._appendImages(data), (e) => console.log(e));
当我使用 FormData 时
const images = messages.map(k => {
return {
uri: k.image, //`file:///${k.image}`,
name: k.filename,
type: mime.lookup(k.filename),
}
})
console.log(images)
postData = new FormData();
postData.append('file', images);
postData.append('userid', this.user._id);
postData.append('time', moment().format('YYYY-M-D H:mm:ss'));
postData.append('group', this.groupID);
axios.post(WebAPI.url.chat.postImage,
postData,
{
headers: {
access_token: this.user.access_token,
'Content-Type': 'multipart/form-data',
},
}
).then(response => {
console.log(response.data)
}).catch(error => {
console.log(error)
})
C#可以获取Request.Form,但是不能获取Request.Files
谁能帮帮我?非常感谢!
【问题讨论】:
标签: c# react-native asp.net-web-api image-upload camera-roll