dongyun234854 2014-03-19 00:30 采纳率: 0%
浏览 37
已采纳

erreur上传图片php

EDIT: translations in italics

salut :)
j'ai l'erreur suivant:

hi :)
I have the following error:

Warning: move_uploaded_file(avatar/essai.jpg): failed to open stream: Permission non accordée in /opt/lampp/htdocs/site/submitfunc.php on line 3
... Permission not granted in /opt/lampp/htdocs/site/submitfunc.php ...

Warning: move_uploaded_file(): Unable to move '/opt/lampp/temp/php2FwMbY' to 'avatar/essai.jpg' in /opt/lampp/htdocs/site/submitfunc.php on line 3

lorsque j'appuie sur valider afin de charger l'image
when I press confirm to load the image

voila ma fonction submitfunc.php :
Here is my function submitfunc.php:

<?php
//la fonction qui va changer l'image de profil
//function that will change the profile picture
move_uploaded_file($avatar_tmp,'avatar/'.$avatar);
mysql_query("

UPDATE membres SET avatar='{$_FILES['avatar']['name']}' WHERE nom='{$_SESSION['nom']}'

");

?>

j'utulise xampp sur ubuntu
I use xampp on ubuntu

de l'aide svp :)
Please help :)

  • 写回答

1条回答 默认 最新

  • dongzhi9032 2014-03-19 01:24
    关注

    Reading the documentation on the function is always a good place to start:
    fr.php.net/manual/fr/function.move-uploaded-file.php
    www.php.net/move_uploaded_file

    Si filename n'est pas valide, rien ne se passe, et move_uploaded_file() retournera FALSE.

    Si filename est un fichier téléchargé, mais que pour une raison quelconque, il ne peut être déplacé, rien ne se passe, et move_uploaded_file() retourne FALSE. De plus, une alerte sera affichée.

    If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.

    If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued.

    The warning message indicates that your Apache process does not have permission to access/write to your destination folder. Use the Linux command chmod to adjust the folder's permission settings to allow apache access.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题
  • ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档
  • ¥50 C++五子棋AI程序编写
  • ¥30 求安卓设备利用一个typeC接口,同时实现向pc一边投屏一边上传数据的解决方案。
  • ¥15 SQL Server analysis services 服务安装失败