[Django] #32004: Improve documentation of request.FILES

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #32004: Improve documentation of request.FILES

Django
#32004: Improve documentation of request.FILES
------------------------------------------------+------------------------
               Reporter:  Janos Roden           |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Documentation         |        Version:  3.1
               Severity:  Normal                |       Keywords:  upload
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 Regarding `request.FILES` and `multipart/form-data` requests I think it
 worth to mention that the `filename` parameter of the `content-
 disposition` header of the part is
 [https://github.com/django/django/blob/master/django/http/multipartparser.py#L625
 crutial] to handle the part as a file.

 I used a low level library to generate requests and I thought Django will
 use a temporary file (and file name) for this content.
 Of course after I found out how it works it's make sense, but read about
 it in the docs would have help me to fix my code much quicker.

--
Ticket URL: <https://code.djangoproject.com/ticket/32004>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.71c0a4cb9b78d42006de5c27dc9ff06d%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
#32004: Improve documentation of request.FILES
-------------------------------------+-------------------------------------
     Reporter:  Janos Roden          |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  upload               |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Janos Roden):

 * cc: Janos Roden (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.cac434491c4b9ea20bc7020e61dc82f1%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
-------------------------------------+-------------------------------------
     Reporter:  Janos Roden          |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  upload               |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Janos Roden:

Old description:

> Regarding `request.FILES` and `multipart/form-data` requests I think it
> worth to mention that the `filename` parameter of the `content-
> disposition` header of the part is
> [https://github.com/django/django/blob/master/django/http/multipartparser.py#L625
> crutial] to handle the part as a file.
>
> I used a low level library to generate requests and I thought Django will
> use a temporary file (and file name) for this content.
> Of course after I found out how it works it's make sense, but read about
> it in the docs would have help me to fix my code much quicker.
New description:

 Regarding `request.FILES` and `multipart/form-data` requests I think it
 worth to mention in the doc that the `filename` parameter of the `content-
 disposition` header of the part is
 [https://github.com/django/django/blob/master/django/http/multipartparser.py#L625
 crucial] to handle the part as a file.

 I used a low level library to generate requests and I thought Django will
 use a temporary file (and file name) for this content.
 Of course after I found out how it works it's make sense, but read about
 it in the docs would have help me to fix my code much quicker.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.e1767f2d3b86870a9a8dad4d44ea28c8%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
--------------------------------------+------------------------------------
     Reporter:  Janos Roden           |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  3.1
     Severity:  Normal                |               Resolution:
     Keywords:  upload                |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Accepted


Comment:

 HI Janos, yes OK. Very happy to look at a suggestion to the docs here.
 Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.895a41290b4a52633aaad5b5eb45f2f3%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
--------------------------------------+------------------------------------
     Reporter:  Janos Roden           |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  3.1
     Severity:  Normal                |               Resolution:
     Keywords:  upload                |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Janos Roden):

 Hi Carlton,

 I'm thinking about [https://docs.djangoproject.com/en/3.1/topics/http
 /file-uploads/#basic-file-uploads this] section:
    Note that `request.FILES` will only contain data if the request method
 was `POST` and the `<form>` that posted the request has the attribute
 `enctype="multipart/form-data"`. Otherwise, `request.FILES` will be empty.

 Could be extended as

    Note that `request.FILES` will only contain data from form fields if
 the request method was `POST` and the `<form>` that posted the request has
 the attribute `enctype="multipart/form-data"` and contains at least one
 `<intput type="file">` field.
    Or more technically if request method was `POST`, the `Content-Type`
 general header was `multipart/form-data` and the `Content-Disposition`
 subpart header contains the `filename` parameter (default behavior in
 browsers for this `enctype`).
    Otherwise, `request.FILES` will be empty.

 Feel free to correct my english, please.
 I hope it isn't too complicated, what do you think?

--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.a2fb766a57b30c12b14cf1fec75a6f4d%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
--------------------------------------+------------------------------------
     Reporter:  Janos Roden           |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  3.1
     Severity:  Normal                |               Resolution:
     Keywords:  upload                |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Carlton Gibson):

 Hi Janos. First glance seems a bit 😬: the point is the `Content-
 Disposition` header right? But how do we state that in the context of form
 submission... — yes, via the input... — Can you open a PR, and we discuss
 there? (It's much easier to review and suggest changes there.) Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.919ea42b16b9ddc47ffb7fb1069edcd0%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
--------------------------------------+------------------------------------
     Reporter:  Janos Roden           |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  3.1
     Severity:  Normal                |               Resolution:
     Keywords:  upload                |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Janos Roden):

 Okay, I created one, let's discuss how to phrase it:
 https://github.com/django/django/pull/13425

--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.df95be0f3a8f4b69ece7fd742ccd02e5%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
-------------------------------------+-------------------------------------
     Reporter:  Janos Roden          |                    Owner:  Janos
         Type:                       |  Roden
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  upload               |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Janos Roden):

 * owner:  nobody => Janos Roden
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.e0c6b8d310a6c8eab2425a873f4877bd%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #32004: Improve documentation of request.FILES

Django
In reply to this post by Django
#32004: Improve documentation of request.FILES
-------------------------------------+-------------------------------------
     Reporter:  Janos Roden          |                    Owner:  Janos
         Type:                       |  Roden
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  upload               |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * has_patch:  0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.72869db1afae337018249f1c68fcc2e7%40djangoproject.com.