Skip to content

upload image failure #641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lihuaying opened this issue Aug 6, 2020 · 0 comments
Open

upload image failure #641

lihuaying opened this issue Aug 6, 2020 · 0 comments

Comments

@lihuaying
Copy link

file {
data: base64,
fileName: "20200805_174105.jpg"
fileSize: 7163
height: 107
isVertical: true
originalRotation: 0
path: "/storage/emulated/0/DCIM/Screenshots/20200805_174105.jpg"
type: "image/jpeg"
uri: "content://media/external/images/media/3045"
width: 106
}
RNFetchBlob.fetch(
'POST',
url,
{
token: token,
'Content-Type': 'multipart/form-data',
},
[
{
fileName: image.fileName,
name: image.fileName,
type: image.type,
data: RNFetchBlob.wrap(image.path),
},
]
)
.then((res: any) => {
console.log(res.text(), '_____res')
})
.catch((err: any) => {
console.log(err, '_____err')
// error handling ..
})

err-info: code: "0019", message: "Please upload a file"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant