【发布时间】:2013-03-18 07:05:20
【问题描述】:
我想将位图图像和其他信息(如用户 ID 和用户名)传递给 php 服务器。 这是我的 php 服务器端 api...
$user_id=$app->request()->post('user_id');
$username=$app->request()->post('username');
$target_path="./images/";
$s_char = array ("'");
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
//Get the uploaded file information
$name_of_uploaded_file = basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
echo "image uploaded====>".$name_of_uploaded_file;
$photo_url='http://192.168.1.239/taxibuddy/api/images'.$name_of_uploaded_file;
$photo_url=str_replace($s_char,"`",$photo_url);
}
我尝试使用事物链接 http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/ 但这是要求指定文件名路径,我想将位图作为参数传递。
【问题讨论】:
-
然后使用 ByteArray 代替文件。
标签: android