You could use StringIO for storing the PIL, and then when updating the web2py record pass the StringIO, and a filename that is a hash of the original filename, this would prove a unique record.
-Thadeus On Mon, Feb 22, 2010 at 1:45 PM, villas <[email protected]> wrote: > Hi Thadeus > You are right, I was just demonstrating a concept rather than writing > production code but I should include some extra lines to help avoid > such issues. Thanks for your constructive comments. > D > > On Feb 22, 4:41 pm, Thadeus Burgess <[email protected]> wrote: >> What if two requests come in at the same time and they overwrite the >> thumbnail.jpg file ? Would there be a conflict or does PIL store the >> image in memory anyways? >> >> Also, web2py hashes the filename, so wouldn't it get overwritten if >> you had multiple thumbnail.jpg of the same size ? >> >> -Thadeus >> >> On Mon, Feb 22, 2010 at 10:18 AM, villas <[email protected]> wrote: >> > Hi Lukasz, >> > I made a web2pyslice from the code I eventually used, which I think >> > was rather similar to that which you proposed. >> >http://www.web2pyslices.com/main/slices/take_slice/62 >> > If you think that 'slice' can be improved, please let me know. >> > I don't believe this solution would work on GAE, so I might try and >> > add a section about that, if and when I get the time. >> > Thanks. >> > --David >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "web2py-users" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group >> > athttp://groups.google.com/group/web2py?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

