Added auto file-type detection for uploads from desktop.