开发者

How to upload files to server using php

开发者 https://www.devze.com 2023-01-25 17:17 出处:网络
$lastid_id = mysql_insert_id(); $folderpath = \"Attachment/\".$lastid_id.\"\".$fileatt_name; if ($uploaded) {
$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

精彩评论

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