Am 11.06.2012 21:26, schrieb 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.
>
>
> If the filename is very long, part of it might get cut off depending
> on the "length" attribute of the upload field (particularly since the
> b16encode increases the name length), so even files with different
> original names could end up with the same truncated b16encode value.
> The uuid will also prevent someone from guessing the URL for a file
> even if they know (or correctly guess) the original filename.
>  
>
>     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
>
>
> Are you using the standard download function, which calls
> response.download()? If so, that only works by checking the db. Or
> having you created a custom download function that just opens the file
> and streams it?
>
> Anthony
>  
Beat me, but I am using the simplest download function

def download():
    return response.download(request,db)

and it works without database entries.
Well - I got a table defined like this:

db.define_table("t_files",
                #Field('file', 'upload', uploadfield='picture_file'),
                Field('f_file', 'upload'),
                migrate=settings.migrate)

But there is nothing in it.

Kind regards
Cornelius

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to