1.IOS端採用post方式請求服務器端的url地址 如:http://192.168.0.12:50000/serverce1.svc/uploadweb
IOS端的代碼採用base64位編碼的方式傳值給WCF,WCF經過解析64位編碼,而後經過流讀取爲byte[]類型的數據,經過讀取byte[]的流將圖片讀取出來,最後進行保存到本地服務器
2.WCF服務端主要的是web.config的配置post
1.在<system.web> </system.web>中 添加 <httpRuntime maxRequestLength="2097151" /> 2097151 單位是字節,能夠根據本身項目的長度去設置編碼
2.配置wcf接口的節點url
2.1 <service behaviorConfiguration="SecondhandBehavior" name="Secondhand">
<endpoint address="" behaviorConfiguration="WebHttpBindingBehavior" bindingConfiguration="MyServiceBinding"
binding="webHttpBinding" contract="ISecondhand">
</endpoint>
</service>spa
2.2 server
2.3 blog
<webHttpBinding> 這個與上面紅色部分的名字要同樣才能夠
<binding name="MyServiceBinding" sendTimeout="00:10:00" transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None" />
</binding>
</webHttpBinding>接口