Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

move_uploaded_file() is not working in kubuntu

Links for php scripts

Moderators: macek, egami, gesf

move_uploaded_file() is not working in kubuntu

Postby amruth » Wed Jan 11, 2012 7:42 am

I'm uploading the image file from my HTML using POST method and I use move_uploaded_file($_FILES["fileid"]["tmp_name"],$path) but it is not moving the file.

$path is /www/items/ has permission 777 and I create another folder inside of items using PHP code as
mkdir("foldername",0777) but that permission is set as rwxr_xr_x(not rwxrwxrwx why?).To this folder I move the uploaded file(but file is not moved).

Any help is greatly appreciated

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Jan 06, 2012 9:23 am

Re: move_uploaded_file() is not working in kubuntu

Postby egami » Wed Jan 11, 2012 11:02 am

so what you need is.
$tmp_name = $_FILES['fileid']['tmp_name'];
$filename = $_FILES['fileid']['name'];

if (move_uploaded_file($tmp_name,"$path/$filename)) {
echo "success.<br>";
User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.