Giter Club home page Giter Club logo

Comments (11)

twisted-trac avatar twisted-trac commented on May 10, 2024
Automation's avatar Automation removed owner

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
Glyph and DP tell me Quotient has code that does this, but it's hacky. Possibly
we could do this at pycon.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
This depends on distrib refactor, which is why I had to back
this out from 0.99.7 or whenever I did it originally.
Benefits would be not storing 20MB uploaded files in memory,
and a few other things which prevent DoS attacks.

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
i keep hearing that twisted caches uploaded files in 
memory, but every time I go look at the http code, it 
seems that this is wrong. Here is the code:

        if length &lt; 100000:
            self.content = StringIO()
        else:
            self.content = tempfile.TemporaryFile()

where "length" is the Content-length that the client has 
sent. So what's the deal?

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
That's because you keep looking at the wrong code ;)
The relevant line is:

  cgi.parse_multipart(self.content, pdict)

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
glyph points out that FieldStorage blocks, which is no good.
So we're going to have to write our own solution.

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
glyph's avatar @glyph commented
#!html
<pre>
Feel like doing some web programming?

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
To rephrase:

1. Store large uploaded files on disk.
2. Don't lose metadata like filename and mimetype which are
still available.
3. Default API for accessing files would be as file-like
objects.
3. Backwards compatability - there is code that expects
files to be strings. should work, while still not actually
storing them as strings in memory until the users actually
do this (mmap, maybe? they look kinda like strings.)

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
moshez's avatar @moshez commented
#!html
<pre>
instead of using mmap, I'd prefer using magical __getattr__ code
which would create these attributes by reading in the files.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
jyknight's avatar @jyknight commented
#!html
<pre>
So I think this is basically waiting for someone to rewrite cgi.parse_multipart in a way that can be fed 
incremental data.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
jyknight's avatar @jyknight commented
#!html
<pre>
I did this a while back: twisted.web2.fileupload
</pre>

from twisted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.