Django 下载

 f = open("mm.jpg", "rb")
  data = f.read()
  f.close()
  response = HttpResponse(data,mimetype='application/octet-stream') 
  response['Content-Disposition'] = 'attachment; filename=mm.jpg'
  return response

 

你可能感兴趣的:(django,F#)