php - upload files to to the same folder -
i created function uploads files. problem i'm calling different file , different folders, means path image folder's changing.
how can set folder absolute?
btw - need work on local computer (using wamp) , linux server (where website located)
$usersfiles = './images/usersfiles/'; if (move_uploaded_file($files['file']['tmp_name'][$i], $usersfiles.$files['file']['name'][$i]))
you can use $_server['document_root'] path root level of website, e.g.
$usersfiles = $_server['document_root'] . '/images/usersfiles/'; if (move_uploaded_file($files['file']['tmp_name'][$i], $usersfiles.$files['file']['name'][$i]))
Comments
Post a Comment