BrendanS
BrendanS

Reputation: 331

Pushing ByteArray to POST

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

Upvotes: 1

Views: 180

Answers (1)

user797257
user797257

Reputation:

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

Upvotes: 3

Related Questions