Very cool, Massimo. Thank you for your quick response! But ...

- Shouldn't that be os.path.join?
- Should I interpret your message as meaning that this will also work
with the standard download function -- the one that does a "return
response.download(request,db)"?
- Can the db.table.field.uploadfolder be any place on the file system,
even places outside of web2py?

On Sep 16, 10:29 pm, mdipierro <[email protected]> wrote:
> Ok. try this:
>
> db.table.field.uploadfolder=od.path.join(request.folder,"uploads/
> somewhere")
>
> reuires trunk. folder somewhere must exist.
>
> On Sep 16, 7:24 pm, Richard <[email protected]> wrote:
>
>
>
> > currently I save uploaded files to an external hard drive, and to
> > avoid additional I/O operations I use uploadfield=False. Then I save
> > the file with:
>
> > Field('model', type='upload', uploadfield=False, requires=IS_NOT_EMPTY
> > ())
> > ...
> > gluon.fileutils.copystream(request.vars.model.file, open
> > (model_filename, 'wb'), int(request.env.content_length))
>
> > Richard
>
> > On Sep 17, 7:29 am, mdipierro <[email protected]> wrote:
>
> > > Currently the only way to achieve this is:
> > > 1) move the file after has been uploaded
> > > 2) write your own download controller so that file can be retrieved.
>
> > > On Sep 16, 3:52 pm, weheh <[email protected]> wrote:
>
> > > > Has anyone successfully been able to store and retrieve uploaded files
> > > > in a place other than applications/myapp/uploads? A subdirectory under
> > > > uploads is OK. I want to store user files in applications/myapp/
> > > > uploads/userid/file.jpg or some variant of that, and then enable users
> > > > to also download their files. I believe that the download function
> > > > will need to be modified to accomplish this, but it's not clear to me
> > > > how to do it.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to