Can anyone explain why files cant be uploaded using AJAX?

前端 未结 4 716
北荒
北荒 2021-01-22 01:06

I have read many articles etc that attempt to explain why a file (e.g. attachment etc) cannot be uploaded via AJAX (atleast without some \'tricks\' behind the scene).

Ca

4条回答
  •  盖世英雄少女心
    2021-01-22 01:40

    File uploads are performed through a standard called multipart/form-data. Javascript has no way of reading the contents of files on the client computer.

提交回复
热议问题