Saving state on 'crash' and accept only certain file-type to upload