. Contoh Anda boleh cuba menjalankan kod berikut untuk menggunakan atribut terima: FileUploadBox</title"/><meta property="og:local" content="ms"> <meta property="og:title" content="Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul-html tutorial-php.cn"> <meta property="og:description" content="Gunakan atribut terima dalam HTML untuk menetapkan jenis fail yang diterima oleh pelayan. Atribut ini hanya boleh digunakan dalam teg <inputtype="file">. Contoh Anda boleh cuba menjalankan kod berikut untuk menggunakan atribut terima: <!DOCTYPEhtml><html> <head> <title>FileUploadBox</title"> <meta property="og:url" content="https://m.php.cn/ms/faq/603305.html"> <meta property="og:image" content="https://img.php.cn/upload/article/000/000/164/169398150539749.jpg"> <meta property="og:site_name" content="php.cn"> <meta property="og:type" content="website"> <link rel="canonical" href="http://www.php.cn/ms/faq/603305.html"/> <link rel="alternate" hrefLang="zh-cn" href="https://m.php.cn/zh/faq/603305.html" /> <link rel="alternate" hrefLang="en" href="https://m.php.cn/faq/603305.html" /> <link rel="alternate" hrefLang="zh-tw" href="https://m.php.cn/zh-tw/faq/603305.html" /> <link rel="alternate" hrefLang="ja" href="https://m.php.cn/ja/faq/603305.html" /> <link rel="alternate" hrefLang="ko" href="https://m.php.cn/ko/faq/603305.html" /> <link rel="alternate" hrefLang="ms" href="https://m.php.cn/ms/faq/603305.html" /> <link rel="alternate" hrefLang="fr" href="https://m.php.cn/fr/faq/603305.html" /> <link rel="alternate" hrefLang="de" href="https://m.php.cn/de/faq/603305.html" /> <meta charset="utf-8" /><meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><meta name="applicable-device" content="mobile" /><link rel="stylesheet" href="/static/css/style.css?4.5.31"><link href="/static/front/mobcss/newphpcommon.css?1.1" type="text/css" rel="stylesheet"/><link href="/static/front/mobcss/swiper.min.css" type="text/css" rel="stylesheet"/><link href="/static/front/mobcss/newphp.css?1.2" type="text/css" rel="stylesheet"/><link href="/static/css/global.css" type="text/css" rel="stylesheet"/><link href="/static/layui/css/layui.css" type="text/css" rel="stylesheet"/><link href="/static/mobcss/mobindex3.css" type="text/css" rel="stylesheet"/><script src="/static/front/mobjs/jquery-1.6.1.min.js"></script><script src="/static/front/mobjs/swiper.min.js"></script><script src="/static/front/mobjs/newphpcommon.js"></script><link rel="canonical" href="http://www.php.cn/ms/faq/603305.html"/> <link rel="alternate" hrefLang="zh-cn" href="https://m.php.cn/zh/faq/603305.html" /> <link rel="alternate" hrefLang="en" href="https://m.php.cn/faq/603305.html" /> <link rel="alternate" hrefLang="zh-tw" href="https://m.php.cn/zh-tw/faq/603305.html" /> <link rel="alternate" hrefLang="ja" href="https://m.php.cn/ja/faq/603305.html" /> <link rel="alternate" hrefLang="ko" href="https://m.php.cn/ko/faq/603305.html" /> <link rel="alternate" hrefLang="ms" href="https://m.php.cn/ms/faq/603305.html" /> <link rel="alternate" hrefLang="fr" href="https://m.php.cn/fr/faq/603305.html" /> <link rel="alternate" hrefLang="de" href="https://m.php.cn/de/faq/603305.html" /> <script> var canshu = { SeeMore:'Lihat lagi', FoldUp:'Melipat', Choice:'bahasa', wait:'Memuatkan, sila tunggu~', LoginFirst:"Sila log masuk dahulu", needKeyword:'Masukkan carian kata kunci', emailPhoneError:'Sila masukkan telefon atau alamat e-mel yang betul', missPwd:'Sila masukkan kata laluan', emailError:'Sila masukkan alamat e-mel anda yang betul', VerCode:"Sila masukkan kod pengesahan", getCode:'Menghantar', pwdError:'Format kata laluan yang salah', TwoPassNotMatch:'Dua kata laluan tidak sepadan', Bindemail:'Ikat e-mel', resetpassword:'menetapkan semula kata laluan', ConfirmPass:'Sahkan Kata Laluan', pwdCheck:'Sila masukkan 6-18 huruf atau nombor', Editinfor: 'Edit maklumat peribadi', trimContent:'Sila masukkan kandungan', titleCheck:'Panjang tajuk hendaklah sekurang-kurangnya 5 patah perkataan', choiceLang:'Sila pilih klasifikasi bahasa', Secondreply:'balas', NetWorkError:'Ralat rangkaian, sila cuba lagi kemudian!', all_lang_string:'zh|en|zh-tw|ja|ko|ms|fr|de' }; </script><!-- Google Tag Manager --><script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-WWVXRJPW'); </script><!-- End Google Tag Manager --><!-- Google tag (gtag.js) --><script async src="https://www.googletagmanager.com/gtag/js?id=G-H42EVCYBJC"></script><script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H42EVCYBJC'); </script><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5902227090019525" crossorigin="anonymous"></script><!--<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6267705206177514" crossorigin="anonymous"></script>--><meta property="article:author" content="PHPz" /><meta property="article:published_first" content="tutorialspoint.com,https://www.tutorialspoint.com/HTML-file-input-control-with-capture-and-accept-attributes-is-not-working-correctly" /><link rel="stylesheet" href="/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css?1"><link rel="stylesheet" href="/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault1.css"><link href="/static/mobcss/newphp.css" type="text/css" rel="stylesheet"/><script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js"></script><script> var xnb_name = 'Virtual currency'; </script><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","headline":"Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul","description":"Gunakan atribut terima dalam HTML untuk menetapkan jenis fail yang diterima oleh pelayan. Atribut ini hanya boleh digunakan dalam teg <inputtype=\"file\">. Contoh Anda boleh cuba menjalankan kod berikut untuk menggunakan atribut terima: <!DOCTYPEhtml><html> <head> <title>FileUploadBox<\/title","image":["https:\/\/img.php.cn\/upload\/article\/000\/000\/164\/169398150582933.jpg"],"datePublished":"2023-09-06T14:25:03+8:00","author":{"url":"http:\/\/m.php.cn\/ms\/member\/164.html","name":"PHPz"},"mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/m.php.cn\/ms\/faq\/603305.html"},"url":"https:\/\/m.php.cn\/ms\/faq\/603305.html","articleBody":"<p><img src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/164\/169398150582933.jpg\" alt=\"Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul\"><\/p>\n<p> Gunakan atribut <em>accept<\/em> untuk menetapkan jenis fail yang diterima oleh pelayan dalam HTML. Atribut ini hanya boleh digunakan dalam teg <input type=\"file\"> <\/p>\n<h2>Contoh<\/h2>\n<p>Anda boleh cuba menjalankan kod berikut untuk menggunakan atribut terima: <\/p><pre class='brush:php;toolbar:false;'><!DOCTYPE html>\n<html>\n   <head>      \n   <title>File Upload Box<\/title>    \n   <\/head>\n   <body>\n      <form>    \n         <input type = \"file\" name = \"fileupload\" accept = \"image\/*\" \/>  \n      <\/form>\n   <\/body>\n<\/html><\/pre><p>Atribut tangkapan ialah sifat boolean yang, jika dinyatakan, menunjukkan bahawa menangkap media terus daripada peranti adalah diutamakan…. Atribut <\/p>\n<p>capture tidak digunakan untuk menyertakan pilihan kamera dalam dialog, tetapi menunjukkan bahawa merakam terus daripada kamera web lebih diutamakan. <\/p>\n<p>Kod \"betul\" diberikan di bawah<\/p><pre class='brush:php;toolbar:false;'><input type = \"file\" accept = \"image\/*\"><\/pre>"}</script></head><body><div class="bodyBg"><!--头部--><div class="nphpHead"><div class="nphpTop"><div class="nphpTopIn"><div class="nphpLogo"><a href="http://m.php.cn/ms/" title="Laman web PHP Cina"></a></div><div class="nphpSubmit"><!-- <a href="http://m.php.cn/ms/search" class="bg1"></a> --><div class="langadivs" ><a href="javascript:;" class="bg4 bglanguage"></a><div class="langadiv" ><a onclick="javascript:setlang('zh-cn');" class="language course-right-orders chooselan " href="javascript:;"><span>简体中文</span><span>(ZH-CN)</span></a><a onclick="javascript:setlang('en');" class="language course-right-orders chooselan " href="javascript:;"><span>English</span><span>(EN)</span></a><a onclick="javascript:setlang('zh-tw');" class="language course-right-orders chooselan " href="javascript:;"><span>繁体中文</span><span>(ZH-TW)</span></a><a onclick="javascript:setlang('ja');" class="language course-right-orders chooselan " href="javascript:;"><span>日本語</span><span>(JA)</span></a><a onclick="javascript:setlang('ko');" class="language course-right-orders chooselan " href="javascript:;"><span>한국어</span><span>(KO)</span></a><a onclick="javascript:;" class="language course-right-orders chooselan chooselanguage" href="javascript:;"><span>Melayu</span><span>(MS)</span></a><a onclick="javascript:setlang('fr');" class="language course-right-orders chooselan " href="javascript:;"><span>Français</span><span>(FR)</span></a><a onclick="javascript:setlang('de');" class="language course-right-orders chooselan " href="javascript:;"><span>Deutsch</span><span>(DE)</span></a></div></div><a href="http://m.php.cn/ms/login" class="bg3"></a></div></div></div><div class="nphpNav"><div class="nphpNavIn"><div class="swiper-container nphpNavSwiper"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/ms/" >Rumah</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/article.html" class="hover">Artikel</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/wenda.html" >Soal Jawab</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/course.html" >Kursus</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/faq/zt" >Topik</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/xiazai" >Muat turun</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/game" >Permainan</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/dic.html" >Kamus</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/update/article_0_1.html" >kemas kini terkini</a></div><div class="clear"></div></div></div><script> var swiper = new Swiper('.nphpNavSwiper', { slidesPerView : 'auto' }); </script></div></div></div><!--头部 end--><div class="bodyMain"><!--所在位置--><div class="nphpSize"><div class="nphpSizeIn"><b></b><p><a href="http://m.php.cn/ms/" title="Rumah" class="bBlack">Rumah</a>  >  <a href="http://m.php.cn/ms/article.html" title="Artikel" class="bBlack">Artikel</a>  >  <a href="http://m.php.cn/ms/web-designer.html" class="cBlack">hujung hadapan web</a>  >  Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul</p><!-- <p><a href="http://m.php.cn/ms/article.html" class="cBlack">Artikel teknikal</a>  >  <a href="http://m.php.cn/ms/web-designer.html" class="cBlack">hujung hadapan web</a> > <a href="http://m.php.cn/ms/div-tutorial.html" class="cBlack">html tutorial</a> > Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul</p> --><div class="clear"></div></div></div><div class="nphpQianBox"><div class="nphpQianTitle"><h1>Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul</h1><div class="nphpQianTitleIn"><span><img data-src="https://img.php.cn/upload/avatar/000/000/164/59190898474f6485.png" alt="PHPz" class="lazyload" src="/static/front/mobimages/moren/moren.png" /></span><dl><dt><em>PHPz</em><i class='bg2'>ke hadapan</i><div class="clear"></div></dt><dd><em>2023-09-06 14:25:03</em><i>1383semak imbas</i><div class="clear"></div></dd></dl><div class="clear"></div></div></div><div class="nphpQianCont wenda-list"><p><img src="https://img.php.cn/upload/article/000/000/164/169398150582933.jpg" alt="Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul"></p> <p> Gunakan atribut <em>accept</em> untuk menetapkan jenis fail yang diterima oleh pelayan dalam HTML. Atribut ini hanya boleh digunakan dalam teg <input type="file"> </p> <h2>Contoh</h2> <p>Anda boleh cuba menjalankan kod berikut untuk menggunakan atribut terima: </p><pre class='brush:php;toolbar:false;'><!DOCTYPE html> <html> <head> <title>File Upload Box</title> </head> <body> <form> <input type = "file" name = "fileupload" accept = "image/*" /> </form> </body> </html></pre><p>Atribut tangkapan ialah sifat boolean yang, jika dinyatakan, menunjukkan bahawa menangkap media terus daripada peranti adalah diutamakan…. Atribut </p> <p>capture tidak digunakan untuk menyertakan pilihan kamera dalam dialog, tetapi menunjukkan bahawa merakam terus daripada kamera web lebih diutamakan. </p> <p>Kod "betul" diberikan di bawah</p><pre class='brush:php;toolbar:false;'><input type = "file" accept = "image/*"></pre><p>Atas ialah kandungan terperinci Atribut tangkap dan terima kawalan input fail HTML tidak berfungsi dengan betul. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!</p></div><div class="nphpQianMsg"><a href="javascript:void(0);">html</a> <a href="javascript:void(0);">input</a><div class="clear"></div></div><div class="nphpQianSheng"><span>Kenyataan:</span><div>Artikel ini dikembalikan pada:tutorialspoint.com. Jika ada pelanggaran, sila hubungi admin@php.cn Padam</div></div></div><div class="nphpSytBox"><span>Artikel sebelumnya:<a class="dBlack" title="Bagaimanakah kita boleh menggunakan tag split untuk menggayakan elemen HTML?" href="http://m.php.cn/ms/faq/603263.html">Bagaimanakah kita boleh menggunakan tag split untuk menggayakan elemen HTML?</a></span><span>Artikel seterusnya:<a class="dBlack" title="Bagaimanakah kita boleh menggunakan tag split untuk menggayakan elemen HTML?" href="http://m.php.cn/ms/faq/603377.html">Bagaimanakah kita boleh menggunakan tag split untuk menggayakan elemen HTML?</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>Artikel berkaitan</h2><em><a href="http://m.php.cn/ms/article.html" class="bBlack"><i>Lihat lagi</i><b></b></a></em><div class="clear"></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><ul class="nphpXgwzList"><li><b></b><a href="http://m.php.cn/ms/faq/348757.html" title="Html小知识总结" class="aBlack">Html小知识总结</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/ms/faq/348804.html" title="如何快速学习HTML" class="aBlack">如何快速学习HTML</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/ms/faq/348873.html" title="html xhtml xml的区别" class="aBlack">html xhtml xml的区别</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/ms/faq/348884.html" title="src与href属性的区别" class="aBlack">src与href属性的区别</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/ms/faq/348902.html" title="关于HTML5和CSS替换使用" class="aBlack">关于HTML5和CSS替换使用</a><div class="clear"></div></li></ul></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><div class="nphpFoot"><div class="nphpFootBg"><ul class="nphpFootMenu"><li><a href="http://m.php.cn/ms/"><b class="icon1"></b><p>Rumah</p></a></li><li><a href="http://m.php.cn/ms/course.html"><b class="icon2"></b><p>Kursus</p></a></li><li><a href="http://m.php.cn/ms/wenda.html"><b class="icon4"></b><p>Soal Jawab</p></a></li><li><a href="http://m.php.cn/ms/login"><b class="icon5"></b><p>saya</p></a></li><div class="clear"></div></ul></div></div><div class="nphpYouBox" style="display: none;"><div class="nphpYouBg"><div class="nphpYouTitle"><span onclick="$('.nphpYouBox').hide()"></span><a href="http://m.php.cn/ms/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/ms/"><b class="icon1"></b><span>Rumah</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/course.html"><b class="icon2"></b><span>Kursus</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/article.html"><b class="icon3"></b><span>Artikel</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/wenda.html"><b class="icon4"></b><span>Soal Jawab</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/dic.html"><b class="icon6"></b><span>Kamus</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/course/type/99.html"><b class="icon7"></b><span>Manual</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/xiazai/"><b class="icon8"></b><span>Muat turun</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/ms/faq/zt" title="Topik"><b class="icon12"></b><span>Topik</span><div class="clear"></div></a></li><div class="clear"></div></ul></div></div><div class="nphpDing" style="display: none;"><div class="nphpDinglogo"><a href="http://m.php.cn/ms/"></a></div><div class="nphpNavIn1"><div class="swiper-container nphpNavSwiper1"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/ms/" >Rumah</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/article.html" class="hover">Artikel</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/wenda.html" >Soal Jawab</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/course.html" >Kursus</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/faq/zt" >Topik</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/xiazai" >Muat turun</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/game" >Permainan</a></div><div class="swiper-slide"><a href="http://m.php.cn/ms/dic.html" >Kamus</a></div><div class="clear"></div></div></div><div class="langadivs" ><a href="javascript:;" class="bg4 bglanguage"></a><div class="langadiv" ><a onclick="javascript:setlang('zh-cn');" class="language course-right-orders chooselan " href="javascript:;"><span>简体中文</span><span>(ZH-CN)</span></a><a onclick="javascript:setlang('en');" class="language course-right-orders chooselan " href="javascript:;"><span>English</span><span>(EN)</span></a><a onclick="javascript:setlang('zh-tw');" class="language course-right-orders chooselan " href="javascript:;"><span>繁体中文</span><span>(ZH-TW)</span></a><a onclick="javascript:setlang('ja');" class="language course-right-orders chooselan " href="javascript:;"><span>日本語</span><span>(JA)</span></a><a onclick="javascript:setlang('ko');" class="language course-right-orders chooselan " href="javascript:;"><span>한국어</span><span>(KO)</span></a><a onclick="javascript:;" class="language course-right-orders chooselan chooselanguage" href="javascript:;"><span>Melayu</span><span>(MS)</span></a><a onclick="javascript:setlang('fr');" class="language course-right-orders chooselan " href="javascript:;"><span>Français</span><span>(FR)</span></a><a onclick="javascript:setlang('de');" class="language course-right-orders chooselan " href="javascript:;"><span>Deutsch</span><span>(DE)</span></a></div></div><script> var swiper = new Swiper('.nphpNavSwiper1', { slidesPerView : 'auto', observer: true,//修改swiper自己或子元素时,自动初始化swiper observeParents: true,//修改swiper的父元素时,自动初始化swiper }); </script></div></div><!--顶部导航 end--><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script></body></html>