IT

net::ERR_UPLOAD_FILE_CHANGED in Chrome

프로개발러 2022. 11. 28. 16:15
반응형

크롬 브라우저에서만 파일 업로드를 하고 나서

ERR_UPLOAD_FILE_CHANGED

에러가 떨어지는 경우가 있다.

 

https://stackoverflow.com/questions/61916331/re-uploading-a-file-with-ajax-after-it-was-changed-causes-neterr-upload-file-c

 

Re-uploading a file with AJAX after it was changed causes net::ERR_UPLOAD_FILE_CHANGED in Chrome

I have a simple HTML form that sends an selected file via AJAX to an API endpoint. If I do the following steps: Press the Upload button and make an POST request to upload the file Change the selec...

stackoverflow.com

 

위의 링크를 참조하면 되고 수정하는 방법은

 

ajax에서 요청을 할 때, 아래 부분을 추가하는 것이다.

}).complete(function (data) {
    $('#formid')[0].reset();
});

formid는 파일 업로드 부분이 있는 <form>태그의 id값이다.

 

크롬만 문제가 있고 IE,엣지에서는 문제가 없다.

반응형