Receive-File
Shows a dialog to users allowing to upload files to either server file system or items in media library.
Syntax
Receive-File [-Description <String>] [-ParentItem] <Item> [-Title <String>] [-CancelButtonName <String>] [-OkButtonName <String>] [-Versioned] [-Language <String>] [-Overwrite] [-Unpack] [-Width <Int32>] [-Height <Int32>]
Receive-File [-Description <String>] [-Path] <String> [-Title <String>] [-CancelButtonName <String>] [-OkButtonName <String>] [-Overwrite] [-Unpack] [-Width <Int32>] [-Height <Int32>]
Receive-File [-ParentItem] <Item> -AdvancedDialog [-Width <Int32>] [-Height <Int32>]
Detailed Description
Executing this command with file path on the server (provided as -Path parameter) provides script users with means to upload a file from their computer. Executing it for an Item located in Sitecore Media library (provided as -ParentItem) allows the user to upload the file as a child to that item. If the file has been uploaded the dialog returns path to the file (in case of file system storage) or Item that has been created if the file was uplaoded to media library.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
Parameters
-Description <String>
Dialog description displayed below the dialog title.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-ParentItem <Item>
The item under which the uploaded media items should be stored.
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
true (ByValue)
Accept Wildcard Characters?
false
-Path <String>
Path to the folder where uploaded file should be stored.
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
true (ByValue, ByPropertyName)
Accept Wildcard Characters?
false
-Title <String>
Dialog title - shown at the top of the dialog.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-CancelButtonName <String>
Text shown on the cancel button.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-OkButtonName <String>
Text shown on the OK button.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Versioned <SwitchParameter>
Indicates that the Media item should be created as a Versioned media item.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Language <String>
Specifies the language in which the media item should be created. if not specified - context language is selected.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Overwrite <SwitchParameter>
indicates that the upload should overwrite a file or a media item if that one exists. Otherwise a file with a non-confilicting name or a sibling media item is created.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Unpack <SwitchParameter>
Indicates that the uplaod is expected to be a ZIP file which should be unpacked when it's received.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-AdvancedDialog <SwitchParameter>
Shows advanced dialog where user can upload multiple media items and select if the uploaded items are versioned, overwritten and unpacked.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Width <Int32>
Dialog width.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Height <Int32>
Dialog width.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Sitecore.Data.Items.Item
System.String
Outputs
The output type is the type of the objects that the cmdlet emits.
Sitecore.Data.Items.Item
System.String
Notes
Help Author: Adam Najmanowicz, Michael West
Examples
EXAMPLE 1
Upload text.txt file to server disk drive. A new file is created with a non-conflicting name and the path to it is returned
EXAMPLE 2
Upload text.txt file to media library under the 'master:\media library\Files' item A new media item is created and returned
EXAMPLE 3
Upload text.txt file to media library under the 'master:\media library\Files' item using advanced dialog. A new media item is created but "undetermined" is returned as the dialog does not return the results.
EXAMPLE 4
Upload text.txt file to media library under the 'master:\media library\Files' item. A new versioned media item in Danish language is created and returned. If the media item existed - it will be overwritten.
Related Topics
Last updated