the private dir is not "exposed" by default (the name "private" should have
give you an hint :-P )......
if you need to do something like that (e.g. a fast way to give access to
some static file) you'd better put them in the /static directory (in that
case it will work with exactly the same code you used).
If you need something that "lists" whatever you have in a fixed directory
of yours, you can use the Expose class
from gluon.tools import Expose
def list_my_dir():
path = os.path.join(request.folder, 'private', 'whatever')
##you shouldn't expose the "private" directory, but if you decided to
do so ....
files = Expose(path=path, basename='wonderful')
return dict(files=files)
On Wednesday, April 24, 2013 5:00:33 PM UTC+2, [email protected] wrote:
>
> Hi all,
>
> It is very simple but i am quite blocked:
> i did a site and I want to give the possibility to load some program and
> files.
>
> exemple :
> Repertory of my site
> MySite
> /private
> myProgram.exe
> myFile.txt
>
> To load the myProgram.exe I put in my form this
>
> <a href=" http://127.0.0.1:8000/MySite/private/myProgram.exe
> ">Download</a>
> but i have one error
> " invalid controller (private/myProgram)"
>
> Somebody can help me because I am quite lost.
>
> ThanksPibol
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.