SavePath Property
Gets or sets the path of the folder on the Web server in which the recording is saved. Read/write.
Usage
ASP.NET markup: | <speech:RecordSound SavePath="..." /> |
Get value: | String = RecordSound.SavePath; |
Set value: | RecordSound.SavePath = String; |
Data type: | String |
Required: | Yes |
Remarks
The SavePath property should contain the full local path of this folder on the Web server, or a local path relative to the ASP.NET process directory. Application authors may find it more convenient to save recorded files in a folder relative to the application path. To obtain the application path, call the Server.MapPath() method.
Write access to the SavePath folder
The PlaybackUrlBase property should contain the Web address of the folder specified in the SavePath property.
There are three ways in which the RecordSound control can access the folder containing the recorded sound files:
Using the ASP.NET account
Under IIS 5.0, this account is called ASPNet; under IIS 6.0, it is called NetworkService. To configure this type of access:- Assign write permissions on the SavePath folder to the ASPNet or NetworkService account, and
- Ensure that the application's web.config file contains no impersonate tag, or the following tag:
<identity impersonate="false"/>
This is the easiest option to configure, and provides the lowest degree of security. Any other ASP.NET application on the Web server could access the recorded files.
Using the client's account
When the client is Microsoft Internet Explorer or TASim, this is the user's account name; when the client is Telephony Application Simulator, this account is TASMachineName\NetworkService. To configure this type of access:- Assign write permissions on the SavePath folder to the client's account, and
- Ensure that the application's web.config file contains the following tag:
<identity impersonate="true"/>
This is harder to configure, but provides a higher degree of security.
Using a specific user account
To configure this type of access:- Assign write permissions on the SavePath folder to the specific user account, and
- Ensure that the application's web.config file contains a tag defining the user account and password as follows:
<identity impersonate="true" username="..." password="..."/>
This option is the hardest to configure, but provides highest degree of security. For further security, these credentials can be encrypted and stored in the Registry.
For a broad overview of ASP.NET security issues, including impersonation, authentication and encryption, see Building Secure ASP.NET Applications.
Read access to the SavePath folder
In order to play recorded sound files from the SavePath folder in an ASP.NET application, the folder must be a virtual directory. For general information on virtual directories, see Using Virtual Directories. For information about creating virtual directories, see How to Create Virtual Directories.
Example
The following example assumes that the playback folder on the Web server is a virtual directory associated with the folder d:\vdirs\playback.
<form id="Form1" method="post" runat="server">
...
<speech:RecordSound ID="RecordSound1"
AutoPostBack="True"
BabbleTimeout="5000" InitialTimeout="1000" MaxTimeout="5000"
Beep="False"
Enabled="True"
EndSilence="1000"
PlaybackUrlBase="http://www.cpandl.com/playback/"
SavePath="d:\vdirs\playback"
SavePartialRecord="False"
SemanticItem="SemanticItem1"
Type="audio/wav"
runat="server">
<Prompt InlinePrompt="Please record your message"></Prompt>
</speech:RecordSound>
...
</form>
See Also
RecordSound Class | RecordSound Constructor | RecordSound Members | RecordSound Properties | RecordSound Methods | RecordSound Events | RecordSound Remarks