Rajesh
Rajesh

Reputation: 163

How to upload files to server using php

$lastid_id = mysql_insert_id();
$folderpath = "Attachment/".$lastid_id."".$fileatt_name;
if ($uploaded) {
    copy($uploaded,$folderpath);
} else {
    if (move_uploaded_file($_FILES["attachcopy"]["tmp_name"],$folderpath)) {
        $uploaded = $folderpath;
    }
}         

Above coding works well in local system but this code con not upload file to server system,Please give any ideas.

Thank you...

Upvotes: 0

Views: 722

Answers (1)

skndstry
skndstry

Reputation: 671

Use phpinfo() to check these settings:

file_uploads should be 'on'

upload_max_filesize should be bigger than the file you want to upload

upload_tmp_dir if empty, it will upload your file to a default path

post_max_size should be bigger than the file you want to upload

and check if you have permission to write to your upload folder.

Upvotes: 5

Related Questions