Tushar
Tushar

Reputation: 5935

Regarding sending a file to Websocket via android application

I want to upload a mp3 file via Websocket in Android Application.

I was using the external library http://autobahn.ws/android/

But the problem is that through this library,I cannot upload a big file.say 5 Mb. I tried researching on similar types of libraries.But could not found a suitable one. Has anyone tried to upload file on WebSocket in Android Application.

Thanks

Upvotes: 0

Views: 810

Answers (1)

Murtaza Khursheed Hussain
Murtaza Khursheed Hussain

Reputation: 15336

As per the mentioned error you are receiving "WebSocketException: frame payload too large", if you go to the source code of the library you are using and search for error you will find out the limitation imposed by the library itself.

// immediately bail out on frame too large

if (payload_len > mOptions.getMaxFramePayloadSize()) {
    throw new WebSocketException("frame payload too large");
}

You'll find the this limitation in WebSocketOptions.java

mMaxFramePayloadSize = 128 * 1024;

Upvotes: 1

Related Questions