When a Box upload fails because the filename already exists, dont retry the same upload. If you know the file ID, POST the new content to the upload-new-version endpoint for that file. If you only know the folder ID and the filename, list the folder's items, find the entry whose name matches, grab its ID, and upload the new version against that ID. That keeps one file with version history instead of an error.

Context: Stack Overflow #16800055 (accepted answer, 8 votes): the asker uploaded via the v2 API and got an error whenever a file with the same name already existed in the folder, since a plain upload refuses to overwrite. The accepted answer: to overwrite a known file, use the Upload a New Version of a File method against the file ID. If you only know the folder ID and filename, call Retrieve a Folder's Items first, match on the name property, and take the id property for the new-version upload.