Re: [web2py] Re: How to intercept download request

2014-05-23 Thread Niphlod
because there's not native "event" on a completed download nor a "callback" 
to use in ANY browser. 
Simply put, there aren't tools in the HTML word to report back a finished 
download.

On Friday, May 23, 2014 8:33:32 AM UTC+2, Mandar Vaze wrote:
>
> Derek,
>
> On Fri, May 23, 2014 at 1:29 AM, Derek >wrote:
>
>> no, i don't see how you could. web2py leaves it up to the webserver to 
>> send the file. you'd need to modify the webserver, but since the webserver 
>> is handed off the path of the file then you have no way of raising an 
>> error, unless you want transfers to block the web2py process...
>>
>
> "Not possible" is acceptable answer (to me).
> The explanation helps answer "why not"
>
> Thanks !!
>
> -Mandar
>
>  
>
>>
>> On Thursday, May 22, 2014 10:46:00 AM UTC-7, Mandar Vaze wrote:
>>
>>> Sorry for the delayed response.
>>>
>>>
>>> On Wed, May 14, 2014 at 12:14 PM, Niphlod  wrote:
>>>
 let's ask another question then. Can you post a link generated by your 
 app that "downloads" something ? just the part after the domain is enough.

>>>
>>> This question definitely helped.
>>> Turns out "download" is request.args(0) (just like "new" "edit" etc.)
>>> I am now able to intercept the download request.
>>>
>>> Next Question :
>>> So checking request.args(0) only tells me that someone "attempted" the 
>>> download.
>>> Is there a way to find out if they "cancelled" or actually completed the 
>>> downloaded ?
>>>
>>> -Mandar
>>>
>>  -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/nWDCgA10REY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to intercept download request

2014-05-22 Thread Mandar Vaze / मंदार वझे
Derek,

On Fri, May 23, 2014 at 1:29 AM, Derek  wrote:

> no, i don't see how you could. web2py leaves it up to the webserver to
> send the file. you'd need to modify the webserver, but since the webserver
> is handed off the path of the file then you have no way of raising an
> error, unless you want transfers to block the web2py process...
>

"Not possible" is acceptable answer (to me).
The explanation helps answer "why not"

Thanks !!

-Mandar



>
> On Thursday, May 22, 2014 10:46:00 AM UTC-7, Mandar Vaze wrote:
>
>> Sorry for the delayed response.
>>
>>
>> On Wed, May 14, 2014 at 12:14 PM, Niphlod  wrote:
>>
>>> let's ask another question then. Can you post a link generated by your
>>> app that "downloads" something ? just the part after the domain is enough.
>>>
>>
>> This question definitely helped.
>> Turns out "download" is request.args(0) (just like "new" "edit" etc.)
>> I am now able to intercept the download request.
>>
>> Next Question :
>> So checking request.args(0) only tells me that someone "attempted" the
>> download.
>> Is there a way to find out if they "cancelled" or actually completed the
>> downloaded ?
>>
>> -Mandar
>>
>  --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/nWDCgA10REY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to intercept download request

2014-05-22 Thread Derek
no, i don't see how you could. web2py leaves it up to the webserver to send 
the file. you'd need to modify the webserver, but since the webserver is 
handed off the path of the file then you have no way of raising an error, 
unless you want transfers to block the web2py process...

On Thursday, May 22, 2014 10:46:00 AM UTC-7, Mandar Vaze wrote:
>
> Sorry for the delayed response.
>
>
> On Wed, May 14, 2014 at 12:14 PM, Niphlod  >wrote:
>
>> let's ask another question then. Can you post a link generated by your 
>> app that "downloads" something ? just the part after the domain is enough.
>>
>
> This question definitely helped.
> Turns out "download" is request.args(0) (just like "new" "edit" etc.)
> I am now able to intercept the download request.
>
> Next Question :
> So checking request.args(0) only tells me that someone "attempted" the 
> download.
> Is there a way to find out if they "cancelled" or actually completed the 
> downloaded ?
>
> -Mandar
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to intercept download request

2014-05-22 Thread Mandar Vaze / मंदार वझे
Sorry for the delayed response.


On Wed, May 14, 2014 at 12:14 PM, Niphlod  wrote:

> let's ask another question then. Can you post a link generated by your app
> that "downloads" something ? just the part after the domain is enough.
>

This question definitely helped.
Turns out "download" is request.args(0) (just like "new" "edit" etc.)
I am now able to intercept the download request.

Next Question :
So checking request.args(0) only tells me that someone "attempted" the
download.
Is there a way to find out if they "cancelled" or actually completed the
downloaded ?

-Mandar

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to intercept download request

2014-05-13 Thread Niphlod
let's ask another question then. Can you post a link generated by your app 
that "downloads" something ? just the part after the domain is enough.

On Wednesday, May 14, 2014 8:10:31 AM UTC+2, Mandar Vaze wrote:
>
> I don't think the debugger is the problem (yet)
> If I put a "print" statement before "return response.download(request, 
> db)" in default/download - that also doesn't work (Nothing gets printed on 
> web2py console)
>
> To clarify my question further :
>
> 1. Is it possible to intercept the download() call ?
> 2. If yes, then which is the correct place to intercept the download() 
> call ?
> Is it app/default/download
>
> OR
>
> app/controller/download
>
> -Mandar
>
> On Wednesday, May 14, 2014 12:24:48 AM UTC+5:30, Niphlod wrote:
>>
>> don't know if it's a problem with the debugger but if you're using only 
>> on download() function all your "inspection" MUST be done in that function 
>> ^_^
>>
>> On Tuesday, May 13, 2014 1:22:25 PM UTC+2, Mandar Vaze wrote:
>>>
>>> I want to audit the downloads - things like "which file was downloaded, 
>>> by whom and when" etc - and then allow the download to proceed.
>>>
>>> I looked at auth.settings.download_url - which is pointing to 
>>> /app/default/download
>>>
>>> So I put debugger (import ipdb;ipdb.set_trace()) in download() function 
>>> in default controller.
>>> But when I click on the file link to download - the execution *does not 
>>> stop* in the debugger
>>>
>>> I have several controllers - I assume for all the controllers - the 
>>> download_url is same (since it is controlled via auth.settings)
>>> But just to try - I added "download" function in my other controller as 
>>> well (and put debugger) - still didn't help
>>>
>>> What am I missing ?
>>>
>>> -Mandar
>>>
>>>
>>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to intercept download request

2014-05-13 Thread Mandar Vaze
I don't think the debugger is the problem (yet)
If I put a "print" statement before "return response.download(request, db)" 
in default/download - that also doesn't work (Nothing gets printed on 
web2py console)

To clarify my question further :

1. Is it possible to intercept the download() call ?
2. If yes, then which is the correct place to intercept the download() call 
?
Is it app/default/download

OR

app/controller/download

-Mandar

On Wednesday, May 14, 2014 12:24:48 AM UTC+5:30, Niphlod wrote:
>
> don't know if it's a problem with the debugger but if you're using only on 
> download() function all your "inspection" MUST be done in that function ^_^
>
> On Tuesday, May 13, 2014 1:22:25 PM UTC+2, Mandar Vaze wrote:
>>
>> I want to audit the downloads - things like "which file was downloaded, 
>> by whom and when" etc - and then allow the download to proceed.
>>
>> I looked at auth.settings.download_url - which is pointing to 
>> /app/default/download
>>
>> So I put debugger (import ipdb;ipdb.set_trace()) in download() function 
>> in default controller.
>> But when I click on the file link to download - the execution *does not 
>> stop* in the debugger
>>
>> I have several controllers - I assume for all the controllers - the 
>> download_url is same (since it is controlled via auth.settings)
>> But just to try - I added "download" function in my other controller as 
>> well (and put debugger) - still didn't help
>>
>> What am I missing ?
>>
>> -Mandar
>>
>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to intercept download request

2014-05-13 Thread Niphlod
don't know if it's a problem with the debugger but if you're using only on 
download() function all your "inspection" MUST be done in that function ^_^

On Tuesday, May 13, 2014 1:22:25 PM UTC+2, Mandar Vaze wrote:
>
> I want to audit the downloads - things like "which file was downloaded, by 
> whom and when" etc - and then allow the download to proceed.
>
> I looked at auth.settings.download_url - which is pointing to 
> /app/default/download
>
> So I put debugger (import ipdb;ipdb.set_trace()) in download() function in 
> default controller.
> But when I click on the file link to download - the execution *does not 
> stop* in the debugger
>
> I have several controllers - I assume for all the controllers - the 
> download_url is same (since it is controlled via auth.settings)
> But just to try - I added "download" function in my other controller as 
> well (and put debugger) - still didn't help
>
> What am I missing ?
>
> -Mandar
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.