[Answered ]-How to pass arbitrary Python object (e.g. InMemoryUploadFile) to a different Django view

1πŸ‘

βœ…

I see your problem can be solved in two ways:

a) InMemoryUploadFile will be deleted after your view (function) returns something.

  1. User send file on view_reciever, where this file will be processed with your business logic, and saved on the cloud and returned to a user as statistic for confirmation, whether it is good or not.
  2. If file is good, then it is already saved on your cloud.
  3. If it is bad – then delete it.

b) Using Ajax request:

  1. User can send file to a view which will only process your file
    and return statistics via ajax request.
  2. If it is good for user, he can send new ajax request with this file, and it would save file in the cloud.
  3. If it is bad, do nothing (but userfriendly) (it isn’t stored on your cloud anyway).
πŸ‘€oruchkin

Leave a comment