saving .wav file into database through script

Version 1
    This document was generated from CDN thread

    Created by: Na How Yee on 11-12-2011 09:09:02 PM
    Hi,
     
    I'm not sure whether I post in the right place, feel free to rediect me. Thanks.
     
    I need to save a .wav file into database through script. Regarding the feedback from Cisco, some said can be done, some said can't be done. This is confusing. Can the .wav file be saved into database through script by using the custom Java code?
    When I try to use the java.io.File, access denied, I can't access to the .wav file. Please find attachment as the reference.

    Any idea? Please advise as this is quite urgent.
     
    Thanks,
    HowYee

    Subject: RE: saving .wav file into database through script
    Replied by: Na How Yee on 12-12-2011 04:15:02 AM
    Hi,

    FYI, the problem solved once I change the 'recordedPromptTempPath' and 'fname' to the [System.getProperty("uccx.customer.dir") + "/Recordings/" + name]
    But I still don't understand why do I get access denied while I try to read file in Prompt Management.

    Thanks,
    HowYee

    Subject: RE: saving .wav file into database through script
    Replied by: Steven Pawlak on 12-12-2011 09:29:36 AM
    HowYee,

    I assume the problem is with the stuff in Blue?

    That would be because your path is wrong. the file is located at DOC["Recordings\" + name].

    The full legal URI is based on the CRTP protocol. Look at Vol1 of scripting, page 2-55

    My guess for that file would be

    "crtp:/Prompts/en_US/Recordings" + name


    the DOC[] in the IVR handles all the "crtp:/Prompts/en_US/" for you.

    Hope this helps

    Subject: RE: saving .wav file into database through script
    Replied by: Na How Yee on 12-12-2011 08:46:54 PM
    Hi Steven,

    Yes, you're right, the problem is with the blue stuff.
    When I change my path to "crtp:/Prompts/en_US/Recordings/" + name, file not found. Please find attachment as the error message.

    Thanks,
    HowYee

    Subject: RE: saving .wav file into database through script
    Replied by: Na How Yee on 12-12-2011 10:30:12 PM
    Hi Steven,

    It is not working either. "No such file or directory". For current situation, I didn't write the document into -> System.getProperty("uccx.customer.dir") + "/Recordings/" + name.
    How to use the ivr reference in place of fname?

    Thanks,
    HowYee

    Subject: RE: saving .wav file into database through script
    Replied by: Steven Pawlak on 12-12-2011 10:05:25 PM
    HowYee,

    I think the document might be wrong. I just looked at some working code that I have that calls a prompt by the raw path. Try this.

    "crtp:/Prompt/lang,en_US/Recordings/" + name


    that is "lang" and a comma before the en_US.


    You know that you can also reference the recording document file from the script inside the Java {} by just referring to it. Use the ivr reference in place of fname.