Rohitashv Singhal Rohitashv Singhal - 1 month ago 7x
PHP Question

Getting error with move_uploaded_file HTTP wrapper does not support writeable connections

I am currently working on a project with php. Here I want to store the image into folder using

but when I use the following code :

if (move_uploaded_file($_FILES['file_promo_image']['tmp_name'], $uploadfile))
echo "Le fichier est valide, et a été téléchargé avec succès.\n";


I am getting the following error :

Warning: move_uploaded_file( [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections. in /homez.534/desgensb/www/sites/bestinfo/admin/record-news.php on line 73

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpfCHv2s' to '' in /homez.534/desgensb/www/sites/bestinfo/admin/record-news.php on line 73

How can I resolve this issue


Use this:

$uploadfile = $_SERVER['DOCUMENT_ROOT'] . '/sites/bestinfo/images/news/CodeCogsEqn.gif';