Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 June 20, 2010 05:50:22

Joshua K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How can I debug file uploads?


Hello,

I have a page with a file upload field. When I submit the page, it
*appears* that the browser is not sending the file data. That is,
when I submit the form, the

request.FILES{}

dictionary contains no file data. What do I need to look at in the
debugger to determine why it's missing?

Thanks,
-Josh

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 20, 2010 05:58:28

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How can I debug file uploads?


On Sunday 20 June 2010 10:20:16 Joshua Kramer wrote:
> I have a page with a file upload field. When I submit the page, it
> appears that the browser is not sending the file data. That is,
> when I submit the form, the
>
> request.FILES{}
>
> dictionary contains no file data. What do I need to look at in the
> debugger to determine why it's missing?
>
is this line in your template:
form enctype="multipart/form-data"
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 20, 2010 06:22:29

Joshua K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How can I debug file uploads?


It was not before, but I added the line; so the form looks like:

<form method="post" enctype="multipart/form-data" action="/projects/
files/add/{{ prjID }}/">

...and still no dice - there isn't anything in the request.FILES
dictionary.

On Jun 20, 12:59 am, Kenneth Gonsalves <law...@au-kbc.org> wrote:
> On Sunday 20 June 2010 10:20:16 Joshua Kramer wrote:>  I have a page with a
> file upload field.  When I submit the page, it
> > appears that the browser is not sending the file data.  That is,
> > when I submit the form, the
>
> > request.FILES{}
>
> > dictionary contains no file data.  What do I need to look at in the
> > debugger to determine why it's missing?
>
> is this line in your template:
> form enctype="multipart/form-data"
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 20, 2010 06:55:05

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How can I debug file uploads?


On Sunday 20 June 2010 10:52:23 Joshua Kramer wrote:
> It was not before, but I added the line; so the form looks like:
>
> <form method="post" enctype="multipart/form-data" action="/projects/
> files/add/{{ prjID }}/">
>
> ...and still no dice - there isn't anything in the request.FILES
> dictionary.
>

and do you have code like:
form = MyForm(request.POST,request.FILES)
if form.is_valid():
do something

in your view?
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 June 20, 2010 07:02:03

Joshua K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How can I debug file uploads?


Ok, I had to add the request.FILES element to the form generation
routine. Now it apears to work! THANKS!

On Jun 20, 1:56 am, Kenneth Gonsalves <law...@au-kbc.org> wrote:
> On Sunday 20 June 2010 10:52:23 Joshua Kramer wrote:
>
> > It was not before, but I added the line; so the form looks like:
>
> > <form method="post" enctype="multipart/form-data" action="/projects/
> > files/add/{{ prjID }}/">
>
> > ...and still no dice - there isn't anything in the request.FILES
> > dictionary.
>
> and do you have code like:
> form = MyForm(request.POST,request.FILES)
> if form.is_valid():
>   do something
>
> in your view?
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support