hi guys,
i'm trying to upload an image, and I get this error:

Warning: move_uploaded_file(http://www.hellohello.com/ecards/images/uploaded/040315011343-yf2b6.jpg): failed to open stream: HTTP wrapper does not support writeable connections. in /home/hellohello/public_html/ecards/upload.php on line 72

Warning: move_uploaded_file(): Unable to move '/tmp/phpPnlHEp' to 'http://www.hellohello.com/ecards/images/uploaded/040315011343-yf2b6.jpg' in /home/hellohello/public_html/ecards/upload.php on line 72

this is the code snippet that contains line 72:

if(function_exists('is_uploaded_file'))
			{
     if(is_uploaded_file($HTTP_POST_FILES['attachment']['tmp_name']))
	{
/*72*/if(move_uploaded_file($HTTP_POST_FILES['attachment']['tmp_name'], $cfg['dir_uploaded_images'] . $pic_name))
	{
chmod($cfg['dir_uploaded_images'] . $pic_name ,octdec(666));
	}
	}
}

whats wrong??

😕

    hi,

    as far as i can see,
    $cfg['dir_uploaded_images']
    represents a web-directory.

    the problem is, that move_uploaded_files works with "real" directories. so you've to find out, where the picture-directory lies on your server.

    f.e. the picture-path could be
    /var/www/html/hellohello.com/ecards/

    your move_uploaded_file-call should look like that:

    move_uploaded_file($HTTP_POST_FILES['attachment']['tmp_name'], '/var/www/html/hellohello.com/ecards/' . $pic_name);

    hope that helps

    stefan

      yeah finger, I did figure it out - and it was the reason that you mentioned - Instead of the http URL specified, i gave the directory path and it works..

      thankx anyway.

        Write a Reply...