Safari 11.1: ajax/XHR form submission fails when input[type=file] is empty

后端 未结 6 550
南笙
南笙 2021-01-30 21:09

UPDATE: As of Webkit build r230963, this issue has been resolved in Webkit.

===========

Since the recent Safari 11.1 update on macOS and iOS, as

6条回答
  •  一生所求
    2021-01-30 21:37

        var fileNames = formData.getAll("filename[]");
        formData.delete("filename[]");
        jQuery.each(fileNames, function (key, fileNameObject) {
            if (fileNameObject.name) {
                formData.append("filename[]", fileNameObject);
            }
        });
    

    Try this !!

提交回复
热议问题