[Grok-dev] File Upload with Tramline

Hannes hannes.flocke at gmx.li
Tue Jan 19 02:36:21 EST 2010


Hi Martijn,

Sorry for that long silence, its just a side project I'm working on and 
I don't have more than one day per week...

Anyway, I don't want to store the files that get uploaded in the ZODB 
not at all! That's why I thought Tramline would be cool, cause I think 
that's the idea of Tramline (when I got it right).

One reason for this is, that I need direct access to the files on the 
filesystem.


thanks.

> 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
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20100119/fe371131/attachment.html 


More information about the Grok-dev mailing list