ajax, jquery , django

13 views
Skip to first unread message

Ekart Dragos-Ioan

unread,
Jun 3, 2012, 9:51:48 AM6/3/12
to django-...@googlegroups.com
Incarc un formular cu ajax si apoi in acel formular incarc o imagine
 
Am incercat astfel in jquery


           $.ajax
            (
            {
                type: 'POST',
                url: $text,
                contentType:'multipart/form-data',
                data : $('#panou').serialize(),
                success: function (data, status)
                {
                    $var.html(data);
                },
                error: function (data, status, e)
                {
                    alert(e);
                }
            }
        );

Dar imi da o eroare cand e sa incare formularul 

MultiPartParserError at /log/modifica_artist/

Invalid boundary in multipart: None
Request Method:POST
Request URL:http://localhost:8000/log/modifica_artist/?id=6
Django Version:1.3.1
Exception Type:MultiPartParserError
Exception Value:
Invalid boundary in multipart: None
Exception Location:/usr/lib/python2.7/dist-packages/django/http/multipartparser.py in __init__, line 65


Are cinve vreo idee ce as putea face?

Ionel Maries Cristian

unread,
Jun 10, 2012, 7:20:46 PM6/10/12
to django-...@googlegroups.com
E din cauza ca 'data' nu e un string in format multipart/form-data.
Daca nu vrei sa faci upload de fisiere prin ajax poti lasa contentType
implicit ('application/x-www-form-urlencoded').


Thanks,
-- Ionel
M.




Reply all
Reply to author
Forward
0 new messages