I've got this working in the past, but only by writing custom create() methods on the Collection and Entry classes.
In the custom create() method you can process the POST/PUT data directly into the FileField just like you would for a normal form Malcolm On Thu, Feb 25, 2010 at 7:03 PM, manu.polline <[email protected]>wrote: > Hi everyone, > anyone help me?? > > On 22 Feb, 19:19, "manu.polline" <[email protected]> wrote: > > Hi everyone, > > my name is Manuel. I'm tryng to upload a file directly in a filefield > > of Django model exposed by django-rest-interface. > > It'is possible? > > this is my model : > > > > class File(models.Model): > > file = models.FileField(upload_to='files', > > help_text=_("file itself")) > > page = models.ForeignKey(page) > > > > and my urls.py : > > json_File_resource = Collection( > > queryset = File.objects.all(), > > authentication = HttpBasicAuthentication(), > > permitted_methods = ('GET', 'POST', 'PUT', 'DELETE'), > > receiver = JSONReceiver(), > > responder = JSONResponder() > > ) > > > > urlpatterns = patterns('', > > .... > > .... > > url(r'^json/File/(.*?)/?$',json_File_resource), > > ... > > ) > > > > The GET works and the PUT to other field too but not the POST or the > > PUT on filefield Field. > > How i can pass the local file to the remote Service in the JSON > > string? > > > > Please Help Me!!! > > > > Manuel > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<django-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

