Am 11.06.2012 19:19, schrieb Anthony:
>
>     my application is generating pdfs which should be available via the
>     normal web2py download controller.
>     I realize, that the file in the uploads/-directory is named like:
>
>        
>     <tablename>.<fieldname>.<something>.<binascii.hexlify(filename)>.pdf
>
>     But what is the something?
>
>
> Looks like it's the last 16 (non-hyphen) characters of a
> uuid: http://code.google.com/p/web2py/source/browse/gluon/dal.py#7897.
>
> Note, for manual uploads, you can call the field's store() method
> directly: http://web2py.com/books/default/chapter/29/6#Manual-uploads.
>
> Anthony
Hi Anthony,
hm, so the uuid seems to be there to take into account, that multiple
files with the same filename might be uploaded. That makes sense,
exspecially if not all files README.txt have the same content.

Interesting enough I was able to totally skip the file database table
completely.
I got a unique name for my data sets and _generate_ files with unique
filenames from those datasets.
I know there is a dataset P03-1232012312.
So if I want to download the file P03-1232012312_EN.pdf I need to call
    .../download/t_files.f_file.xxx.5030332d31323332303132333132.pdf

which works without any database table.
Hm, I hope I do not miss anything.

Kind regards
Cornelius

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to