OverWriteFiles Property

Object: SoftArtisans.FileUp
Syntax: OverWriteFiles
Type: Boolean
Read/Write: Read/Write
Description:

This property determines if an upload will overwrite an existing file on the server.

Note: By default, this property is True, so files will be over-written.

If this property is set to false, the following error will be raised at run-time when a file that already exists on the server is uploaded again:

Error: 183 ... Cannot create a file when that file already exists. (SoftArtisans.SAFile.1)

The above error can be handled and/or the CreateNewFile property can be used to generate a new, unique filename.

This property must be set before the upload is cached. In ASP, this means that the value must be set before referencing any form elements.

Note: When using the HttpModule with an ASP.NET upload, since the HttpModule caches the upload before FileUp is instantiated, this property will have no effect.
Examples:
ASP <%
'--- Create an instance of SoftArtisans FileUp
Set fileUpload = Server.CreateObject(SoftArtisans.FileUp)

'--- Set the default path to store uploaded files
fileUpload.Path = "C:\temp"

'--- Set OverWriteFiles to False
fileUpload.OverWriteFiles = False
%>
ASP.NET N/A

Copyright © 2010 SoftArtisans, Inc. All rights reserved.