ã¨ããã¨ã©ã¼ã«ã¯ã¾ã£ã
ãã®ã¨ã©ã¼ã¯ãã©ã¦ã¶ä¸ã«ã¯è¡¨ç¤ºããã consoleãã°ã«ã§ããã°ã§ã
çµç·¯
ãã¡ã¤ã«ãã¢ããããããã°ã©ã ãã¤ããã¾ãã
ãã©ãã°ã¢ã³ãããããã§ã¢ããããæ©è½ãªã®ã§ãã ãã¡ã¤ã«åè¨ã®ãã¤ãã180ï½200Mãè¶ ãããããã§
net::ERR_INCOMPLETE_CHUNKED_ENCODING
ã¨ããã¨ã©ã¼ãã§ã¾ãã»ã»ã» 質ãæªãã®ã¯ãµã¼ãã¼ã®ãã°ã¯200ã§ãã
htaccessãã¡ã¤ã«ã«HTTP 1.0ãå¼·å¶ãã¦åé¡ã解決ã§ãã¾ããï¼ SetEnv downgrade-1.0 ããã¯åé¡ãåãé¤ããããããHTTP 1.1ãHTTP 1.1ã«å¼·å¶ãããã¨ã¯é©åãªè§£æ±ºçã§ã¯ããã¾ããã https://codeday.me/jp/qa/20181208/59946.htmlããå¼ç¨
ã¨æ¸ãã¦ãã£ããèªåã®ç°å¢ã§ã¯æåããªãã£ã
ã¢ã³ãã¦ã¤ã«ã¹ã®ãªã¢ã«ã¿ã¤ã ä¿è·ãç¡å¹ã«ãããã¨ã§æåãã¾ãã http://thisinterestsme.com/err_incomplete_chunked_encoding/ ããå¼ç¨
ã¢ã³ãã¦ã¤ã«ã¹ããªãã«ãããã¨ã¯ä¼ç¤¾ã®æ¹éçã«ã§ããªã
ã©ããããã¦ããã®ã¨ã©ã¼ã解æ¶ãããªãã£ãã®ã§
ãã©ãã°ã¢ã³ãããããããããã¡ã¤ã«é¡ãåå²ãã¦éä¿¡ããã¨ããäºããããªã£ã
åç´ãªåæå¦çããéåæå¦çã®å¤æ´ãªã®ã§ã¯ã¾ã£ã
ã¯ã¾ã£ãå 容
javascriptã®ã¨ã©ã¼ããããã«ãã
javascriptã®ã¨ã©ã¼ããããã¨åç´ãªç»å表示ããã¦ãã¾ã å¿ è¦ãªé¨åãã¨ã£ã¦event.preventDefault()ãã
async function onUpload_Drop(event){ var fd = event.dataTransfer.files;//eventã«å¿ è¦ãªé¨åã åå¾ãã event.preventDefault();//eventã®ç ´æ£
event.dataTransfer.filesã«ã¯sortã®ã¡ã½ããããªã
ä»ã¾ã§ã¯åããå´ã§ã½ã¼ãå¦çããã¦ããããéä¿¡åã«ã½ã¼ãããªãã¨ãããªãã£ã
ã ããã©ãã°ã¢ã³ãããããããã¤ãã³ãã®filesã¯é
åãªãã ãã©
sortã®ã¡ã½ããããªãã£ã
ã©ããã¦ãªãã®ãããããªãã®ã§
ä¸æ¦é
åã«çªã£è¾¼ãã§ã½ã¼ãããæ·»åãä¿åããããã«ãã
var fd = event.dataTransfer.files; var fdsortdatas = []; for (var i=0; i< fd.length; i++) { //console.log(fd[i].name); fdsortdatas.push({"soeji": i, "name": fd[i].name}); } console.log(fdsortdatas); fdsortdatas.sort(function(a,b){ if(a.name<b.name) return -1; if(a.name > name) return 1; return 0; }); console.log(fdsortdatas);
ãã¼ãã£ã³ã°ã®ç»åã表示ãããªã
èªåã§ãæ²ããããã¡ã¤ã«ã¢ããä¸ã«ãã¼ãã£ã³ã°ã® gifãåºãã®ãå ¨ç¶ã§ããªãã¦await ãããã¦ç¡çãã表示ããã ãããæ£è§£ã®ãããããªã
//âããã«åæ ãããªã document.getElementById('uploadform').style.display="none"; document.getElementById('loading').style.display="block"; //0.5ç§å¾ ã¤(styleåæ ã®ãã) const a = await timewaitResolve(1); //styleåæ ã®ããã«setTimeoutã§å¾ 㤠function timewaitResolve(value) { return new Promise(resolve => { setTimeout(() => { resolve(value); }, 500); }) }
ææ³
éåæå¦çã«ä½ãå¤ãã¯ããã©ãããã åæå¦çã®æ¹ãä½ãã¯æ¥½ã ãã»ã»ã»å¦çæéã¯éåæå¦çãªãã ãã©ã»ã»ã»