在PHP中receved图像的上传脚本ANDROID问题 [英] problem for receved image in php with upload script ANDROID

查看:197
本文介绍了在PHP中receved图像的上传脚本ANDROID问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个code上传图片:
<一href=\"http://vikaskanani.word$p$pss.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/\" rel=\"nofollow\">http://vikaskanani.word$p$pss.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/

i use this code for upload image: http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/

我换成

bm = BitmapFactory.decodeFile("/data/data/fshizzle.com/files/image.jpg");

HttpPost postRequest = new HttpPost("http://10.0.2.2/upload.php");

这一切!

我不能receved信息
我用这个code PHP的工作,如果使用html code

I can not receved info in php file i use this code php work if use html code

<form method="POST" action="upload.php" enctype="multipart/form-data">
     <!-- On limite le fichier à 100Ko -->
     <input type="hidden" name="MAX_FILE_SIZE" value="100000">
     Fichier : <input type="file" name="avatar">
     <input type="submit" name="envoyer" value="Envoyer le fichier">
</form>

code PHP:

CODE PHP:

$dossier = './upload/';
$fichier = basename($_FILES['sfsdfsdf']['name']);
if(move_uploaded_file($_FILES['sfsdfsdf']['tmp_name'], $dossier . $fichier)) 
//Si la fonction renvoie TRUE, c'est que ça a fonctionné...
{
     echo 'Upload effectué avec succès !';
}
else //Sinon (la fonction renvoie FALSE).
{
     echo '<br>Echec de l\'upload !';
}

一个简单的如果(使用isset($ _ FILES ['sfsdfsdf']))不工作有什么好的code?

a simple if(isset($_FILES['sfsdfsdf'])) don't work what is a good code ?

推荐答案

解决我测试与MYDNS和我真正的手机,它的工作。

Solved i test with Mydns and my real phone and it's work.

这篇关于在PHP中receved图像的上传脚本ANDROID问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆