在PHP中receved图像的上传脚本ANDROID问题 [英] problem for receved image in php with upload script 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屋!