Dovrebbe essere sufficiente scrivere:

window.location.href='upload_nl.php?tipo=header&di v=' + divimg;