Pushing ByteArray to POST

2019-08-10 01:10发布

I have a ByteArray of a sound recording. I would like to make a POST request that sends this as a file.

Can I do this without having the user save the file because I can only see FileReference.upload as a way to send files to POST and I don't know how to make a FileReference from a ByteArray. Thanks.

Brendan

1条回答
戒情不戒烟
2楼-- · 2019-08-10 01:26

Yes, you can, use URLLoader and set it's format to binary, then you can put the bytearray into data property of request object.

查看更多
登录 后发表回答