It's tricky, but everything you need is in the encoded filename. With
uploadseparate=True, the file is stored in a subfolder named
/table.field/[first 2 characters of filename uuid]. Try something like this:
sub = file.split('.')
url = URL('static', 'userpics/%s.%s/%s/%s' % (sub[0], sub[1], sub[2][:2],
file) )
Anthony
On Wednesday, December 21, 2011 2:29:15 PM UTC-5, Yarin wrote:
>
>
> I was trying trying to bypass the download function and use a static
> link
>
> According to Massimo:
> "In 'uploads' if you need authorization. In 'static' if you do not. In
> the latter you do not need to worry about
> authorization and you can let the web server by-pass web2py"
>
> I actually think the download link will work for me in this case, but
> was wondering how it could be done for static links.
>
>
> On Dec 21, 1:18 pm, Adi <[email protected]> wrote:
> > wouldn't this bring exactly the path where you store it:
> > <div id="image-div"><img src="{{=URL('download', args=image.file)}}"
> > width="100px" alt="some text" /></div>
> >
> > maybe i'm missing the mark?