【发布时间】:2015-10-13 11:23:48
【问题描述】:
我可以从我的手机成功上传一张图片,但是当我在笔记本电脑上看到个人资料时,方向发生了变化。
$upload_path = 'uploads/';
$filename = $_FILES['userfile']['name'];
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
header("Location: profileOne.php?error=PICTURE");
//die('The file you attempted to upload is too large.');
if(!is_writable($upload_path))
die('You cannot upload to the specified directory, please CHMOD it to 777.');
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path .$user_id.".jpg")) {
$check=@copy($upload_path .$user_id.'.jpg', '../backend/data/profile_image/'.$user_id.'.jpg');
if($check){
$postdata1 = http_build_query(
array(
'user_id' => $user_id,
'img'=>'data/profile_image/'.$user_id.'.jpg',
'type'=>'web'
)
);
$opts1 = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata1
)
);
$context1 = stream_context_create($opts1);
$endPoint1='http://www.ridorama.com/backend/registration/update_profile/';
$result1 = file_get_contents($endPoint1, false, $context1);
【问题讨论】:
-
设备摄像头的图像?
-
是的,我从移动设备拍摄的图像。
标签: android image-uploading image-upload