Monday, February 29, 2016

Re: Ajax + Django + jQuery + HTML5

On Sun, Feb 28, 2016 at 9:46 PM, <setivolkylany@gmail.com> wrote:
>
> I need get path to local file in <input type='file'> for ImageField.
> Next, transfer path to my view thought Ajax request, update in database and
> almost all.
>
> I need will make it manually, for my goals.
>
> May be, anyone known how it make?
>
> I am tried already django-ajaximage, Ajaxfileupload and many other, but it
> not working correct for me.

You cannot retrieve the path of the submitted file server side, it is
simply not possible - browsers will not share that information with
you, neither via HTTP requests, nor by poking at the DOM with
javascript.

If it is absolutely necessary, you must provide a second text input
and have the user manually put the information in there. Bear in mind
that there would be no way of verifying that what the user put in that
box is at all correct.

Can you explain what you are trying to do rather than what is going
wrong, because I think that would be illuminating.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1L2dMrH%3DdUDuUaTN9J84Emnj0BA8woNkzbMDUgNqR75Rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment