I see. So what do you propose? Note, web2py preserves the case of both the 
filename (though it is actually b64encoded) 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.
>>>
>>

Reply via email to