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

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -