add ID to upload form and check if ID exist to avoid loading invalid javascript code for read-only views.