change file name on download

23 views
Skip to first unread message

Wes James

unread,
Feb 12, 2009, 12:36:51 PM2/12/09
to web2py Web Framework
You know how filenames are changed on file upload? I have a field
that retains the original filename. Is there a way when a person
starts downloading a file that the download file name is set to the
original name?

For example:

pic1.jpg is uploaded to the server and it is now
table.field.uuid-uuid4.jpg (or something like that)

now when you click on the download for that image the person gets pic1.jpg.

-wj

mdipierro

unread,
Feb 12, 2009, 12:42:31 PM2/12/09
to web2py Web Framework
yes. That is explained in the manual.
Basically you need a to store the original filename in another field
and set the Content-Disposition header parameter when you return the
file.

Massimo

Wes James

unread,
Feb 12, 2009, 12:43:27 PM2/12/09
to web...@googlegroups.com
ok - thx

mdipierro

unread,
Feb 12, 2009, 12:59:24 PM2/12/09
to web2py Web Framework
I think this may be somewhat automated more. let me look into it.

On Feb 12, 11:43 am, Wes James <compte...@gmail.com> wrote:
> ok - thx
>
Reply all
Reply to author
Forward
0 new messages