@Multipart
@POST(HttpConstants.FILEUPLOADJSON1)
Call<Result>uploadImage(@Part MultipartBody.Part file,@Query("stdID")int stdID);
PHP 부분
$stdID=$_POST['stdID'];
$file_path = "profile_images/";
$file_path = $file_path . basename($_FILES['uploaded_file']['name']);
$actualpath="http://myservices.96.lt/$file_path";
$sql = "UPDATE testuser SET profile_photo = '".$actualpath."' WHERE user_id = '".$stdID."'";
if(mysqli_query($conn,$sql))
{
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path))
{
$result = array("result" => "success", "value" => $sql);
}
else
{
$result = array("result" => "error file transfer");
}
}else{
$result = array("result" => "error mysql");
}
echo json_encode($result);
정밀에 대한 작업을 바랍니다! 그게 무슨 문제 야? – azizbekian
서버에서 이미지를 가져 오는 중 테이블이 값을 업데이트하지 않고 어디에서 지연됩니까? –
멀티 파트 요청 내에서 @Query 매개 변수를 보내려고합니다 –