The filecmp.cmp() method takes two arguments, path of file1 and path of file2. InMemoryUploadedFile objects won't have any path associated with them. So, what is the simplest method to compare two InMemoryUploadedFile objects?
Thanks
The filecmp.cmp() method takes two arguments, path of file1 and path of file2. InMemoryUploadedFile objects won't have any path associated with them. So, what is the simplest method to compare two InMemoryUploadedFile objects?
Thanks
You will have to store the file somewhere on the server and do the comparison.
you can refer to the documentation https://docs.djangoproject.com/en/3.2/topics/http/file-uploads/#basic-file-uploads
after the comparison, you can either store the file or delete it.