Hi Massimo!

It is not my intention to bypass anything as I'd prefer you experts to
do the framework business.  Rather, I wish to know what the best
course of action would be.

I cannot retrieve a file which was uploaded using SQLFORM.factory

My SQLFORM.factory renames and places my file on the filesystem via
store() in dal.py, excellent.

I cannot use URL('default', 'download', args=spam) as it throws an
<type 'exceptions.KeyError'>('spam')

I believe the issue stems from my only table defined in models are for
auth and I'm using OrientDB for everything else.

So when I call download() there is no table for it to reference to get
the filename.

How should I go about retrieving the file I uploaded with my
SQLFORM.factory?

At the cost of sounding repetitious, thank you Massimo.  My positive
experiences with this community is part of what drove me towards
web2py and away from other projects.

-David

On Sep 28, 7:25 pm, Massimo Di Pierro <[email protected]>
wrote:
> Before we get into this discussion. Why are you bypassing the normal
> mechanism?
>
> Massimo
>
> On Sep 28, 5:51 pm, TheSweetlink <[email protected]> wrote:
>
> > SQLFORM.factory renames and uploads my file to uploads/ dir via
> > store() in dal.py  great.
>
> > In form.accepts (will refactor code to use .process() soon) I store
> > the new filename in a currently unsupported db.
>
> > What is the safe/proper/best way to retrieve my file?
>
> > I know the renamed filename but since there is no table defined in a
> > model the web2py download function won't work for me.  It requires db.
>
> > The only way I can think of is opening the file with plain python and
> > skipping the download function altogether.
>
> > Would skipping the download function open my app up to security
> > hazards?  I planned to use it with authorization but that's a no go
> > without a model.
>
> > I appreciate anyone pointing me in the right direction.  Thank you.
>
> > -David Bloom
>
>

Reply via email to