Possible Duplicate:
Django-tastypie: Any example on file upload in POST?
I currently do cURL POST requests to my API like so
curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"username":"theusername", "api_key":"anapikey", "video_title":"a title", "video_description":"the description"}' http://localhost:8000/api/v1/video/
but now I need to be able to add a video file to the upload. I have been looking around for a few hours about uploading files with Tastypie and I have not come up with one solid response. Do I need to add the Base64 encode? If so how? How do I acces the file after I have uploaded it with a POST request? Just normal request.FILES actions? I am not looking to save the file to the database, just get the path to the file.
#Models.py
class Video(models.Model):
video_uploader = models.ForeignKey(User)
video_path = models.CharField(max_length=128)
video_views = models.IntegerField(default=0)
upload_date = models.DateTimeField(auto_now_add=True)
video_description = models.CharField(max_length=860)
video_title = models.SlugField()
I am thoroughly confused on how to implement a file upload system for Tastypie so any help would be very appreciated. Thanks!