2013-04-18 164 views
0

我目前正在尝试从我的iOS应用程序上传图片到php后端。我在网上跟踪了样本;但是,我收到的PHP错误代码为3(UPLOAD_ERR_PARTIAL)。谁能帮我吗?我正在使用[NSURLConnection sendAsynchronousRequest:queue:completionHandler]。上传图片iOS到PHP

我读过一些人禁用连接标题,但那也不起作用。我应该检查哪些服务器端?

<? 
$uploaddir = '';  //Uploading to same directory as PHP file 
$file = basename($_FILES['userfile']['name']); 
$uploadfile = $uploaddir . $file; 

if ($_FILES['userfile']['error'] === UPLOAD_ERR_OK) { 

} else { 
    die("Upload failed with error code " . $_FILES['userfile']['error']); 
} 
?> 
+0

见我的答案[这里](HTTP://计算器。 COM /问题/ 15965682 /如何对上传图像到服务器使用JSON的/ 15965845#15965845) – 2013-04-18 05:02:53

回答