title: How to get image coming from curl request to my Server [PHP]
body: <p>I want to upload an image via curl request from below command.</p>
  
  <pre><code>curl --user name:abc --data-binary @demo.png -i localhost:80/post/index.php --output new.txt
  </code></pre>
  
  <p>Code of index.php</p>
  
  <pre><code>&lt;?php
  Print_r($_POST);
  ?&gt;
  </code></pre>
  
  <p>I am getting output like below in txt file.</p>
  
  <pre><code>HTTP/1.1 100 Continue
  HTTP/1.1 200 OK
  Date: Tue, 17 Apr 2018 08:24:14 GMT
  Server: Apache/2.4.25 (Unix) OpenSSL/1.0.2j PHP/7.1.1 mod_perl/2.0.8-dev Perl/v5.16.3
  X-Powered-By: PHP/7.1.1
  Content-Length: 7075
  Content-Type: text/html; charset=UTF-8
  
  Array
  (
      [âPNG] =&gt; ˝ŒÊêOﬂ›˙ƒ˚€√¿ú&gt;ÿ~ﬁ€
  ≥W^Ç©Kf|‚`V”W8&lt;ˆ÷ö3∞ÎòﬂœÛKõbSJOÖE•œ=Íá¯ˆ7òFÁ√ ¨Ω`3ƒ∏‘2»*®iΩ
  N^J§ããÿ∆kcÙ÷ó~∞lw|uÆ˛'o|t&gt;¯Ê|∏#bå&gt;˙6í&gt;á9´=`Ê
  Wòıâ¿¢œúÃj¡Z'XˆÂ˘üÊï»¢uΩ∑Q”s[⁄{Ó∏xÜÔX≥Â|∂Ì¸≠#≠Ÿ|“r™ÏÜXY◊¡—pﬁ=Í’∞ÔT¨ŸÊ[z”g≠p=∂ñovÖãê[,ﬂ∞LHÕ©∂    b
  [A¨ïµÄì˚uòº‰0êïô©áòÎO…`⁄2'≥ç] =&gt; 
  [õï7_(eπ∂gUÌ}ÿ“—ájÌñîÀ⁄æ;}Â©√g˝¿TáŒ˙¬)ó»_¨OˇÒ!¶Á’Åõo2ƒ•ïO*Æhúúñ_˚^TbÒÊÊ∂ÓC7‚ãN^ …8ôw™Q•] =&gt; úëW≥=1£‚£jYÎõ)YUøÛ$KL ¨¥b
  AttèÄÁßoÄŸÀN¡íÕ°!~q⁄&lt;ƒaÄüí.ø8P@§ì≥(Ç∞U≠ªâ™=ƒÕ VV7ˆ∏_ç˛ãß_,ÂÂÆ^·dïPRŸ~I!Ú†]º„û%7›X\—®Pjäï-:MG◊{y{Û‚Ì;à∑n#ÚE4JŸ⁄›CP%eU pIMÛŒ´°/&lt;}
  BlÑ¯¬¨M0e¡fòµÙ$Å±¢©ŒP@tÛM¥®K~âœíe®5›C±5∫!åK.∏Ò—∫„èº·$Ëu
  ﬁ_{üÆVX.ÒZD.l;Ë≈DÂó C[;zZ4´ªÔ6r®–vﬂB˛[≠Ωâù]É‚buhÑ¯o~_CÍ¢ÔÒ˜˘w]›7±≠≥Ø£ºJôôXº\™Ë¸ŸQ:Êi∑´_ˇ€70ô@Œ\zbÑk[Çx?∫è±¿aàé1≈1 ÔzÊ|IçJB'| ª†“óí«§≈ ¡;´Ω∑ÊL]≤ˆûÄI#ñçÜòÛ¯  ÁÎÛ’⁄ÅD≤¥ª=}w4#∞ïZ;H á–ûæ€˜t=C≈ó}ó“y?A *D=»-dëÚÎP“D=¿0w«@ÛƒÄã∫FÆËòØ$º›Ÿ’__R!ü¥r„iò˝¡nò˚—°ÖÀ¬KÛ∂¡æì@Ó) rL¸˛Ã5àL*~ÆVﬁzEXYÒ√@≥¶[j_ˇ¨©oãŒ*®õ|∆5‚” -Bºí\˚Îê1?‹N•åuÜòC5†5e◊sÜ\‹⁄Ÿ Ì‘&gt;óZJÅ&lt;O(
  [π,˚û_n—≈3B"s◊»ïj«7∂:v—âÇhº∏yèaèÜBÀæ¯¬_ÉhjëoSù8Òcg†:—b
  </code></pre>
  
  <p>I want to save demo.png from any computer to my PHP server.Please some one help me in this.</p>