Io invece credo tu debba modificare questo:

Codice PHP:
header ("Content-Disposition: inline; filename=$nomefile"); 
in:

Codice PHP:
header ("Content-Disposition: attachment; filename=$nomefile");