开发者

File Upload in Web not working

i have working codes from my server which is really working using Xampp server but when i uploaded it to my hosting site, it seems the whole uploading isn't working.. what is missing? the temp folder? do i need to make a temp 开发者_如何学Cfolder to my hosting site?


Make sure for:

  • Upload limits on the server, php.ini
  • Folder permissions, chmod to 755
  • You are specifying the correct path
  • You have used the enctype in form attribute
  • Turn on error reporting in case it is off

Update:

The enctype should be set to enctype="multipart/form-data" eg:

<form enctype="multipart/form-data">

And you can turn on error reporting by putting these lines on top of your script:

ini_set('display_erros', true);
error_reporting(E_ALL);

Additionally try to see what does $_FILES array contain after form is submitted:

echo '<pre>';
print_r($_FILES);
echo '</pre>';


I am sure you have not settup the permission for your upload path. Check the permission for upload path. First try by making the permission to world write format (777).


Check two things :

  • The folder where file gets uploaded exist on server or not ?
  • Write permissions on that folder
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜