将媒体文件从iPhone上传到服务器

时间:2011-07-25 15:28:51

标签: iphone web-services rest soap image-uploading

我正在开发一个可以将媒体文件(音频,视频,图像)上传到服务器的应用程序。我发现了一种使用PHP服务器代码的方法,我们能够在服务器中获取图像并存储它。我想知道将图像上传到服务器(SOAP或REST或使用PHP)的更好方法是什么。

2 个答案:

答案 0 :(得分:0)

Microsoft有一篇关于如何使用DIME(直接Internet消息封装)

的文章

IBM也有another way of sending soap attachments看起来有点老了。

答案 1 :(得分:0)

首先使用soap上传文件有两种方法是使用base64_decode()和base64_encode()方法 而anothere使用的是由android(SOAP)php服务器发送的URL。 代码是

   $tmpfile1 = './ABC.wmv'; (file from location)  
   $filename1 = 'video';      
   $handle1 = fopen($tmpfile, "r");(open in read mode)                   
   $contents1 = fread($handle1, filesize($tmpfile1));
   fclose($handle1);                                 
   $profile_video   = base64_encode($contents); (and decode it)