Jgunzblazin Jgunzblazin - 1 year ago 87
PHP Question

temp file not getting placed in sub directory

Been trying to figure out why my

file will not get placed in the
directory. The directory structure gets created but the temp file is not moved there. To verify a temp file is being created - if I remove the
the temp file is added to
. How come the file is not being created in sub directory?


$temp = 'uploads/'.mkdir('uploads/'.$un) . md5($_FILES['image']['name']);

if (move_uploaded_file($_FILES['image']['tmp_name'], $temp)) {
// do something here..

Answer Source

Use like this,

  $temp = "uploads/$un/" . md5($_FILES['image']['name']);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download