Home Search

DriveWorks Pro 21
Upload File to File Share

Send Feedback

Upload File to File Share

Uploads a file to an Azure File Share.

Properties

Property NameDescription
Connection StringThe connection string for the Storage Account.

See the Microsoft article Configure Azure Storage connection strings for more information.

Share NameName of the File Share.
Share PathThe File Share path to upload the file into. Leave blank to upload to the root directory. The Task will attempt to create any non-existent directories before uploading the file.

Must adhere to the following rules:

  • A path name must not exceed 2048 characters in length.
  • The depth of subdirectories in the path must not exceed 250.
  • Directory and file names must not exceed 255 characters in length.
  • Directory and file names must not use the following characters: " \ : | < > * ? /
  • Directory and file names must not be empty or consist only of whitespace.
  • Directory and file names must not have their last character be a full stop.
  • Directory and file names must not have their last character be whitespace.
  • Directory and file names must not only consist of full stop characters.
OverwriteIf true, overwrite the file if it already exists.
File Path The path to the file to upload. Relative paths are resolved to the Specification directory if no prefix is defined. Accepted prefixes: <Project>, <Specification>, <SpecificationMetadata>, <GroupContent>.

When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.

Example

Upload File to Root Directory Example

Property NameExample RuleExample ResultMeaning
Connection StringDWVariableAzureStorageConnectionString DefaultEndpointsProtocol=https; AccountName=MyExampleName; AccountKey=MyExampleAccountKey; EndpointSuffix=core.windows.net This is the connection string used to identify the Azure Storage Account to connect to.
Share Name"My File Share"My File ShareThis is the name of the File Share to upload the file to.
Share Path"" This is the Azure File Share Path to upload the file to. A blank or empty value will upload the file to the root directory.
OverwriteTRUETRUE Set to TRUE, if the file exists already in the Azure File Share then it will overwrite the existing file.
File PathDWSpecificationFullPath&"\Quote.docx"C:\Main\MyDocuments\Specifications\Parent 121\Quote.docxThis is the File Path of the target file to upload to Azure File Share.

Upload File to Sub-Directory Example

Property NameExample RuleExample ResultMeaning
Connection StringDWVariableAzureStorageConnectionString DefaultEndpointsProtocol=https; AccountName=MyExampleName; AccountKey=MyExampleAccountKey; EndpointSuffix=core.windows.net This is the connection string used to identify the Azure Storage Account to connect to.
Share Name"My File Share"My File ShareThis is the name of the File Share to upload the file to.
Share Path"DirectoryA/DirectoryB"DirectoryA/DirectoryB This is the Azure File Share path to upload the file to. The file will be uploaded 'DirectoryA/DirectoryB'.
OverwriteFALSEFALSE Set to FALSE, if the file exists already in the Azure File Share then the task will not upload the file.
File PathDWSpecificationFullPath&"\Quote.docx"C:\Main\MyDocuments\Specifications\Parent 121\Quote.docx This is the File Path of the target file to upload to Azure File Share.

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • File <File Name> has been uploaded to the File Share <Share Name>.

Success with Warnings

  • N/A - should never be fulfilled

Failed (one of the following occurred)

  • The provided <File Path> is null or empty. Please provide a <File Path>.
  • The provided <File Path> could not be resolved.
  • The <Share Path> is not a valid Azure File Share Path.
  • The <File Path> is not a valid Azure File Share Directory Name.
  • Unable to find or create the <Share Path> to upload the file to.
  • Error occurred creating the <Share Path> to upload file to.
  • Provided Path <File Path> does not contain an eligible file to upload (Please check the format of the file, and if the size is above 0 bytes).
  • File already exists in the FIle Share <Share Path>. To overwrite, please set the Overwrite property to true.

More Information

DriveWorks can be hosted on Microsoft Azure, for more information see Microsoft Azure.