Rohitashv Singhal Rohitashv Singhal - 1 year ago 139
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

Answer Source

Use this:

$uploadfile = $_SERVER['DOCUMENT_ROOT'] . '/sites/bestinfo/images/news/CodeCogsEqn.gif';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download