<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post/1771/</link>
<title><![CDATA[[原创]PHP curl上传图片方法。。。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 12 May 2009 06:45:28 +0000</pubDate> 
<guid>http://www.jackxiang.com/post/1771/</guid> 
<description>
<![CDATA[ 
	网上一堆代码，没有一个真正实现curl传图片成功过的，这儿，我来个成功的，超级简单，扩展性强【广告一下】<br/>上传端：<br/><br/><div class="code">&lt;?php<br/>function upload_curl_pic()<br/>&#123;<br/>$url&nbsp;&nbsp;= &#039;http://localhost//5-5-5//uploadfile.php&#039;;&nbsp;&nbsp;//target url<br/>$file = &#039;c:/21.jpg&#039;; //要上传的文件<br/>$fields&#91;&#039;f&#039;&#93; = &#039;@&#039;.$file;<br/>$ch = curl_init();<br/>curl_setopt($ch, CURLOPT_URL, $url );<br/>curl_setopt($ch, CURLOPT_POST, 1 );<br/>curl_setopt($ch, CURLOPT_POSTFIELDS, $fields );<br/>curl_exec( $ch );<br/>if ($error = curl_error($ch) ) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die($error);<br/>&#125;<br/>curl_close($ch);&nbsp;&nbsp;<br/>&#125; <br/>upload_curl_pic();//可以扩展把图片地址传到函数中<br/>?&gt;</div><br/>接收端：<br/><div class="code">&lt;?php<br/>$uploaddir = &#039;E:&#92;&#92;wwwroot&#92;&#92;www&#92;&#92;htdocs&#92;&#92;5-5-5&#92;&#92;pic_all_here&#92;&#92;&#039;;<br/>$uploadfile = $uploaddir . $_FILES&#91;&#039;f&#039;&#93;&#91;&#039;name&#039;&#93;; <br/> if (move_uploaded_file($_FILES&#91;&#039;f&#039;&#93;&#91;&#039;tmp_name&#039;&#93;, $uploadfile))<br/>&#123;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;File is valid, and was successfully uploaded.&#92;n&quot;;<br/>&#125; else &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Possible file upload attack!&#92;n&quot;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &#039;Here is some more debugging info:&#039;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br/><br/>?&gt;</div>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post/1771/#blogcomment63808</link>
<title><![CDATA[[评论] [原创]PHP curl上传图片方法。。。]]></title> 
<author>8110103278 &lt;8110103278@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 26 Sep 2012 02:00:29 +0000</pubDate> 
<guid>http://www.jackxiang.com/post/1771/#blogcomment63808</guid> 
<description>
<![CDATA[ 
	你好 假如我post其他数据时候最前面也是@这个符号。请问有啥好办法解决么
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post/1771/#blogcomment63934</link>
<title><![CDATA[[评论] [原创]PHP curl上传图片方法。。。]]></title> 
<author>lvv2 &lt;lvv2com@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 27 Mar 2014 02:16:50 +0000</pubDate> 
<guid>http://www.jackxiang.com/post/1771/#blogcomment63934</guid> 
<description>
<![CDATA[ 
	不错，直接拿来用了..
]]>
</description>
</item>
</channel>
</rss>