There are (at least) two ways to handle file upload with Django / Tastypie :
1/ As stated in my comment :
you can make use of Tastypie's features regarding the matter. Django-tastypie: Any example on file upload in POST?
2/ You can go the Django way :
https://docs.djangoproject.com/en/1.6/topics/http/file-uploads/
A quick example (using a view) :
@csrf_exempt
def handle_uploads(request):
if request.method == 'POST':
uploaded_file = request.FILES['file']
file_name = uploaded_file.name
# Write content of the file chunk by chunk in a local file (destination)
with open('path/to/destination_dir/' + file_name, 'wb+') as destination:
for chunk in uploaded_file.chunks():
destination.write(chunk)
response = HttpResponse('OK')
return response