Let me explain the problem.

When you upload a file you can put it where you like using
uploadfolder. The file gets renames

    table.field.JUNK.extension

where JUNK is a UUID including the b16encoded original filename. So
far so good.

Now if you try to download the file with

    http://..../app/default/download/table.field.JUNK.extension

the default download action retrieve the table, the field and the
record that contains a reference to the file. If authentication is
enforced (not your case) it checks permissions for that record and
field.

It then retrieves and returns the file. This is the problem. In this
phase it looks for the file in uploadfolder which is an attribute of
the db.table.field, not as attribute of the file (it could not be).

One option you have is store the folder name in the record with the
file and write your own download function that retrieves and uses the
information.

Massimo





On Jan 11, 4:12 pm, weheh <richard_gor...@verizon.net> wrote:
> How do you set the subfolders? You cannot set them in the action that
>
> > does the upload. You can only set them via
> > db.table.field.uploadfolder=.... in the model since the download
> > action needs to know about them.
>
> Yes - that smells like it's causing the behavior I'm seeing. My model
> sets the db.table.field.uploadfolder=... But then my view needs to
> iterate on a list of files and their respective owner's download
> folder. So I'm trying to get download to look in a different uploads
> subfolder for each different file, where the subfolder is keyed to the
> user. How do I do that?
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to