How do I upload large (> 25MB) files to a web service?

后端 未结 8 1862
野趣味
野趣味 2020-12-07 15:56

I have a web service that takes a byte[] and saves it.

This works fine for \"small\" files, but once I hit a certain size the web service fails and returns \"The req

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 16:19

    If I was stuck having to use web services and needed to support very large files I would look at implementing a system that allows you to upload files in pieces.

    Eg.

    • ticketId GetTicket(size)
    • UploadData(ticketId, byte[] payload) (this can be called as many times as you want)
    • FinalizeUpload(ticketId)

    This would allow you to chunk up the big uploads, and not hold too much data in memory. The disadvantage is that you are still using a fairly inefficient transport mechanism.

提交回复
热议问题