`
haohappy2
  • 浏览: 325851 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

send image and audio to server through APP

    博客分类:
  • APP
 
阅读更多
		header('content-type:text/html;charset=utf8');

		$ch = curl_init();

		//加@符号curl就会把它当成是文件上传处理
		$data = array(
			'img'=>'@'. dirname(__FILE__).'/test/1.jpg',
			/*'audio'=>'@'. dirname(__FILE__).'/test/1.amr',*/
			'room'=>'test',
			'user'=>'test'
		);
		curl_setopt($ch,CURLOPT_URL,$url);
		curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
		curl_setopt($ch,CURLOPT_POST,true);
		curl_setopt($ch,CURLOPT_VERBOSE, true);
		//curl_setopt($ch,CURLOPT_STDERR,  'php://output');
		curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
		if(curl_exec($ch) === false){
			echo 'Curl error: ' . curl_error($ch);
		}else{
		    $result = curl_exec($ch);
			var_dump($result);
		}
		curl_close($ch);
		echo $result;

 

分享到:
评论

相关推荐

    Java email send image

    FileDataSource fds = new FileDataSource("path/to/image.jpg"); imagePart.setDataHandler(new DataHandler(fds)); imagePart.setFileName(fds.getName()); Multipart multipart = new MimeMultipart(); multipart...

    SuperSocket 自定义AppServer、AppSession、CommandBase

    继承`SuperSocket.SocketServer.AppSession`并重写其成员,如`ReceiveDataFrom`、`Send`、`OnSessionClosed`等,以实现个性化功能。 3. **CommandBase**:CommandBase是处理客户端请求的核心部分。每个命令通常对应...

    Android代码-Android-RTMP-Muxer

    It has been tested with Android MediaCodec encoder to send H264 (avc) video and with Android MediaRecorder to send AAC audio via RTMP to a server. RFCs This implementation uses the RTMP 3 protocol ...

    An ASP Component to Send Arbitary Large File from Server to

    标题中的"An ASP Component to Send Arbitary Large File from Server to"指的是一个ASP(Active Server Pages)组件,它的主要功能是允许服务器向客户端高效地传输任意大小的文件。在Web开发中,这种组件对于处理大...

    Free SMTP Server

    Free SMTP Server is able to send thousands of emails per minute with a regular DSL Internet connection. The user interface of the program is very easy to learn, excellent documentation is included. ...

    sketch插件send to Flinto

    《Sketch与Flinto之间的无缝对接:使用“Send to Flinto”插件》 在数字产品设计领域,Sketch和Flinto都是设计师们不可或缺的工具。Sketch以其强大的矢量绘图功能和直观的界面,成为了UI/UX设计师的首选设计软件;...

    Server Side development with Node.js and Koa.js

    The book shows you how Koa can be used to start projects from scratch, register custom and existing middleware, read requests, and send responses to users. We will explore the core concepts in Koa, ...

    server_client_app.zip_TCPserver app_clients.c

    本项目“server_client_app.zip”包含了一个简单的TCP服务器应用程序(TCPserver)以及客户端应用(app_clients.c),它们用于演示如何实现多客户端连接到同一服务器的场景。 首先,我们来看服务器端。TCP服务器的...

    spserver0.9.5最新代码

    the SPServer project - send all contributions to "spserver@googlegroups.com". 2. Static linking of applications to the SPServer library does not constitute a derivative work and does not require the...

    send to onenote

    "Send to OneNote" 是一个方便的功能,它允许用户快速将网页、文本、图片等内容保存到Microsoft OneNote这款强大的笔记应用程序中。这个功能通过右键菜单集成,使得无论是浏览网页还是处理其他文档时,都能轻松地将...

    计算机网络第六版答案

    14. If the two ISPs do not peer with each other, then when they send traffic to each other they have to send the traffic through a provider ISP (intermediary), to which they have to pay for carrying ...

    ActiveXperts SMS and Pager Toolkit3.2_crack

    SMS and Pager Toolkit can send and receive SMS messages directly through a modem capable GSM phone or a dedicated SMS device (also called ‘SMS modem‘). The toolkit also supports SMSC dial-in ...

    sendserver.py

    sendserver.py

    .Net下的文件监视系统

    RDAServer: Defines a server object that exposes a number of methods that are used to capture the screen image of the server computer and convert it into byte stream. The object also provides methods ...

    Android Studio Cookbook

    After that, you will learn how to create an Android app that can send and receive text and images using Google Cloud or Parse as a backend. It explains the concepts of Material design and how to ...

    SQL Server 2012 Data Integration Recipes: Solutions for Integration Services PDF

    Need to export data and send it to another system? SQL Server 2012 Data Integration Recipes has your back. You'll find solutions for importing from Microsoft Office data stores such as Excel and ...

    PHP实现HTML5的Serversentevents用于实时从server推送信息到client比Websocket更简单代替AJAX

    A simple and efficient library implemented HTML5's server-sent events by PHP, is used to real-time push events from server to client, and easier than Websocket, instead of AJAX request.

    iOS eCommerce App Development with Parse(Apress,2015).pdf

    iOS eCommerce App Development with Parse uses a real-world app example to teach you how to build a complete eCommerce iPhone app powered by Parse—the most popular and powerful Platform as a Service ...

Global site tag (gtag.js) - Google Analytics