Is Upload using chunks and MultipartFile upload same.What makes the difference? I have tried upload using Multipartfile. My requirement is to upload a file of 50 mb appx to server without making the user to wait for long time. it is taking roughly about 2 mins.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Chunks and Multipart do the same in a different way
Chunks make the upload "splitting" the whole file in little pieces (chunks)
This allows to split very large file (also 1GB) in smaller pieces and send them to the server without having the connection timeout issue in a browser; then it's up to the server side processing the chunks
You can use several JS upload libraries for the chunks (e.g. https://blueimp.github.io/jQuery-File-Upload/ or http://www.plupload.com/ and so on)
Multipart, instead, uploads the file in one shot; if the file is 1MB all the 1MB is uploaded, if it's 1GB all the 1GB is loaded
Regarding to the transfer velocity i guess it's something related to the bandwidth and internet connection
I hope this can help you
SERVER SIDE CHUNKS MANAGEMENT SAMPLE
As I told you it's up to the server side to manage chunks; I would strongly avoid to store in memory chunks this because you should allocate a huge amount of memory (if the file is 1GB you should allocate 1GB and this for each upload)
In my old project I used plupload and this is an extract of how i managed the chunks on server side (note: code done by using Spring)
As you can see first I check if I receive the whole file or not; if not I write the file in append mode otherwise i write it in total
I hope this is useful
Angelo