Based on this example:
$.jRecorder ({
'rec_width': '300',
'rec_height': '200',
'rec_top': '0px',
'rec_left': '0px',
'recorderlayout_id' : 'flashrecarea',
'recorder_id' : 'audiorecorder',
'recorder_name': 'audiorecorder',
'wmode' : 'transparent',
'bgcolor': '#ff0000',
'swf_path': 'jRecorder.swf',
'host': '{{=URL('acceptfile',vars=dict(filename='hello.wav'))}}',
'callback_started_recording' : function(){},
'callback_finished_recording' : function(){},
'callback_stopped_recording': function(){},
'callback_error_recording' : function(){},
'callback_activityTime': function(time){},
'callback_activityLevel' : function(level){}
});
the file is never saved to the client. It is just sent to the server
acceptfile. I am not sure how it is posted but I guess the bytes are in
request body and filename is just a parameter you pass to the action. For
example this may work:
def acceptfile():
filename = request.get_vars.filename
content = request.body.read()
open(filename,'w').write(content)
return 'done'
On Wednesday, 18 September 2013 15:38:41 UTC-5, Andreas Wienes wrote:
>
> Hello Massimo,
>
> thanks for your reply. I try to record audio using jRecorder (
> https://github.com/sythoos/jRecorder/blob/master/html/example1.html) in
> one of my apps. The recorded file should be saved on the server. I assume I
> have to post the file to the server because there is the line '
> http://yourdomain.com/acceptfile.php?filename=hello.wav' , //replace with
> your server path please in the script.
>
> All the best
> Andreas
>
>
> Am Mittwoch, 18. September 2013 20:56:01 UTC+2 schrieb Massimo Di Pierro:
>>
>> You cannot upload a file using GET variables. It must be done using POST
>> multipart forms. Can you explain better your workflow?
>>
>> On Wednesday, 18 September 2013 12:32:27 UTC-5, Andreas Wienes wrote:
>>>
>>> Hello,
>>>
>>> I want to upload a file by posting it from another script calling
>>> something like http://mydomain.com/default/acceptfile?filename=test.txt
>>> What is the easiest way doing this?
>>>
>>> Thanks a lot for your help!
>>> Andreas
>>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.