开发者

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.开发者_如何学C

Thank you...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜