<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                實現步驟如下: **1. 服務端代碼** ```java @Component @ServerEndpoint(value = "/v1/download") public class DownLoadController { @OnMessage public void download(String message, Session session) throws IOException, EncodeException { File file = new File(message); FileInputStream input = new FileInputStream(file); byte[] content = new byte[1024]; while (input.read(content) != -1) { session.getBasicRemote().sendObject(content); } session.getBasicRemote().sendText(200 + ""); } } ``` **2. 前端代碼** ```js var socket = null const blobList = [] /** * 連接服務端 */ function connect() { socket = new WebSocket('ws://localhost:8090/v1/download') socket.onmessage = (e) => { if (e.data instanceof Blob) { blobList.push(e.data) } if(e.data === '200') { let blob = new Blob(blobList) const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = new Date() + '.mp4' link.click(); window.URL.revokeObjectURL(link.href); } } } /** * 上傳下載參數 */ function downloadFile() { socket.send('e:/upload/websocket/tem.mp4') } ``` >[warning]提醒:上面的代碼下載文件時需要將文件合并,使用的計算資源是客戶的瀏覽器,如果下載較大的文件時可能會導致客戶瀏覽器卡。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看