I am sending an ajax request with a file to my backend that processes it. After processing it into another form (image into a compressed processed directory), I want to send that back to the user to down load that. Can someone provide an example view that will, when it receives the file, process the data the send a request that has the file. Also, please show me how to download that file in the javascript front end.
class send_text:
def post(self, request):
file = request.POST["file"]
# Processing…………… file_to_send = <path to file>
# show how to send the file here
Also the frond end:
$.ajax{
//sending the data
onSuccess: //show how to download the data here
}
Thank you in advance.