N
N
Nube2018-04-07 16:36:19
go
Nube, 2018-04-07 16:36:19

Are there any advantages to transferring data via webscoket?

I am trying to upload images, files. To do this, I use the standard FormFile("file") function, but I also saw an option where FileReader js + webscoket is used, which sends as base64. The file size will be somewhere around 100 mb. I am currently using webscoket as a transport and was thinking of using file transfer through it. Is there any benefit of transferring files via webscoket, like showing download level etc. I would like to know whether it's worth "tinkering" with webscoket or using standard features.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2018-04-07
@Nube

e.g. display load level

And without webscoket you can https://learn.javascript.ru/xhr-onprogress
To download a batch of data in one direction, messing around with webscoket is definitely not worth it. You will only get crap with exception handling in the style of downloading a piece of data and the connection is broken, while part of the data flew to the server and began to be processed.
Is it one file? Maybe it makes sense to shake on the client before sending?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question