[web2py] Re: How do i get mu download function to download my image with its original name

2020-06-03 Thread mostwanted
Thank you Dave, I'm just seeing you reply today but totally appreciated.

On Friday, April 24, 2020 at 8:59:05 AM UTC+2, Dave S wrote:
>
>
>
> On Saturday, April 18, 2020 at 8:57:59 AM UTC-7, mostwanted wrote:
>>
>> I want to download an image but i want it to download with its originally 
>> saved name, is there a way I can modify my download function to do this? So 
>> far its downloading properly as desired its just that its renaming images 
>> with dates e.g:
>> * (IMG-20200418-WA0002)*
>>
>>
>
> I believe what you want to do is to set the headers, something like:
>
> response.headers['Content-Disposition']='attachment;filename=graph.%s'%
> request.args(0)
>
>
> A quick search of the book didn't turn that up, so I must have gotten it 
> from postings in the forum.   The closest my quick search turned up was 
> Content-Type in  http://web2py.com/books/default/chapter/29/10/services?search=header>, 
> beginning with generic.xml.
>
> /dps
>
>  
>
>> *IMAGE BEING DOWNLOADED*
>>
>> {{for details in details:}}
>> 
>> > "250px" width="250px"/>
>> 
>> {{=details.name}} *Download Image*
>> {{=details.place}}
>> 
>> {{pass}}
>> 
>>
>> *DOWNLOAD FUNCTION*
>> def download():
>> return response.download(request, db)
>>
>> Regards;
>>
>> Mostwanted
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f9392c2e-cd1b-432c-ad9d-e44f69c479fd%40googlegroups.com.


[web2py] Re: How do i get mu download function to download my image with its original name

2020-04-24 Thread Dave S


On Saturday, April 18, 2020 at 8:57:59 AM UTC-7, mostwanted wrote:
>
> I want to download an image but i want it to download with its originally 
> saved name, is there a way I can modify my download function to do this? So 
> far its downloading properly as desired its just that its renaming images 
> with dates e.g:
> * (IMG-20200418-WA0002)*
>
>

I believe what you want to do is to set the headers, something like:

response.headers['Content-Disposition']='attachment;filename=graph.%s'%
request.args(0)


A quick search of the book didn't turn that up, so I must have gotten it 
from postings in the forum.   The closest my quick search turned up was 
Content-Type in 
http://web2py.com/books/default/chapter/29/10/services?search=header>, 
beginning with generic.xml.

/dps

 

> *IMAGE BEING DOWNLOADED*
>
> {{for details in details:}}
> 
>  "250px" width="250px"/>
> 
> {{=details.name}} *Download Image*
> {{=details.place}}
> 
> {{pass}}
> 
>
> *DOWNLOAD FUNCTION*
> def download():
> return response.download(request, db)
>
> Regards;
>
> Mostwanted
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/44302899-1904-43be-9b1a-514bc94ec4e6%40googlegroups.com.