[Grok-dev] File Upload with Tramline

Souheil CHELFOUH trollfot at gmail.com
Tue Jan 12 02:31:44 EST 2010


I can again put my 2 cents here
There is a package called dolmen.blob you can use for blobs.
And again, if you use paster, you can set up gp.fileupload, instead of
trameline (then you don't need blobs)
I can help you with both integration if needed
there are many exemple of that in Dolmen's code

2010/1/12 Martijn Faassen <faassen at startifact.com>:
> Hey,
>
> Hannes wrote:
>> I've another concern. I played a little bit with Tramline and HurryFile.
>>
>> How do I get a upload widget? How do I handle the remote file transfer
>> from the client to the server?
>>
>> Is this all done automatically? The HurryFile sample code from PyPi has
>> some gaps... :-(
>
> I agree that the example has gaps - it isn't a great example as it was
> primarily written for testing purposes..
>
> For normal file uploads you could use hurry.file, setting the widget as
> a custom_widget to your form (find a form tutorial), but you could even
> just resort to a 'schema.File' field and everything should work.
> hurry.file just makes a few things a bit more convenient (like retaining
> the uploaded file when the form failed to validate instead of forcing a
> reupload).
>
> The difficulty is with storing large files in the ZODB. Tramline is one
> way around this (you can find tramline's INSTALL.txt here):
>
> http://codespeak.net/svn/rr/tramline/trunk/
>
> This makes use of Apache's upload and download facility but can be
> somewhat involved to set up.
>
> Alternatively these days the ZODB is quite capable of storing large
> files as a "blob". Tramline can be avoided that way (even though the
> performance of tramline would probably be a bit higher for many uploads
> or downloads).
>
> z3c.blobfile can be used to help storing large files in a convenient way.
>
> http://pypi.python.org/pypi/z3c.blobfile
>
> An example of this can be found here (in an older grok application, and
> no UI bits are included as this is a web service):
>
> http://code.google.com/p/imagestore/source/browse/trunk/src/imagestore/image.py
>
> (and imagecontainer.py. actually the use is only very minimal so perhaps
> not that instructive)
>
> Once you get something figured out we'd be very happy to see a tutorial
> or howto appear on grok.zope.org by the way. :)
>
> Regards,
>
> Martijn
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>


More information about the Grok-dev mailing list