Hi Anthony, Sorry I did not see your reply until now. The only thing I can propose is that the extension is also included in the encoding. The renamed filenames could then be totally lowercase which would be more logical (to me) at the expense of having the renamed filenames slightly longer. I concede that if I'm the only one bringing up this matter, then it would be a low priority. :)
Thanks for your comments which helped me to understand what was going on. David On Friday, June 15, 2012 4:36:44 PM UTC+1, Anthony wrote: > > I see. So what do you propose? Note, web2py preserves the case of both the > filename (though it is actually b16encoded) and the extension (which is not > encoded) so the original filename can be reconstructed when the file is > downloaded. If you want extensions to be converted to lowercase, it would > have to be an option, not the default behavior. > > Note, you can define db.mytable.myfield.custom_store and > db.mytable.myfield.custom_retrieve functions to handle the file storing and > retrieving however you like, but then you would have to implement all the > store and retrieve logic on your own. > > Anthony > > On Friday, June 15, 2012 4:24:15 AM UTC-4, villas wrote: >> >> My use case is this: >> I am saving the files in static and providing a way to allow users to >> copy and paste the image URLs into other webpages. If some urls have >> uppercase extensions it looks odd, so the (windows) user is tempted to >> make them lowercase to look neater, but then of course they do not work. >> >> >> On Friday, June 15, 2012 1:48:41 AM UTC+1, Anthony wrote: >>> >>> Are you saying you want the file stored on the server to end in .jpg, >>> but when the user downloads the file, you want it to revert back to .JPG? >>> In that case, why do you care whether the version on the server is lower or >>> upper case -- nobody sees that version? >>> >>> Anthony >>> >>> On Thursday, June 14, 2012 8:29:58 PM UTC-4, villas wrote: >>>> >>>> Looks like I can do this in 'onvalidation': >>>> >>>> request.vars.myfield.filename = request.vars.myfield.filename.lower() >>>> >>>> But then the original filename would not be restored on download. >>>> >>> --

