…  ` |  Allows configuring any transfer settings using [ raw format ](/eng/docs/rawtransfersettings) as in an INI file. E.g. to enable preserving of directory timestamps, use ` -rawtransfersettings  PreserveTimeDirs=1  ` . The switch should come only after other parameters.   
  
_Advertisement_

Aliases: ` send ` , ` mput `

Effective [ options ](/eng/docs/scriptcommand_option) : ` [ confirm
](/eng/docs/scriptcommand_option#confirm) ` , ` [ reconnecttime
](/eng/docs/scriptcommand_option#reconnecttime) ` , ` [ failonnomatch
](/eng/docs/scriptcommand_option#failonnomatch) `

XML  log elements: ` [ upload ](/eng/docs/logging_xml#upload) ` , ` [ mkdir
](/eng/docs/logging_xml#mkdir) ` , ` [ chmod ](/eng/docs/logging_xml#chmod) `
(with ` -permissions  ` ), ` [ touch ](/eng/docs/logging_xml#touch) ` (with `
-preservetime  ` )

##  Examples

    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) index.html
    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) -delete index.html about.html ./
    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) -permissions=644 index.html about.html /home/martin/public_html/
    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) d:\www\index.html about.*
    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) *.html *.png /home/martin/backup/*.bak
    
    
    [put](https://winscp.net/eng/docs/scriptcommand_put) -filemask=*.html -resumesupport=on *

##  Converting to .NET Assembly

When [ converting script to .NET Assembly ](/eng/docs/library_from_script) ,
map ` put ` command to ` [ Session.PutFiles
](/eng/docs/library_session_putfiles) ` method.

Parameters mapping: Command parameter ` file ` maps to method parameter `
localPath ` . When multiple source file parameters are used, you need to call
` Session.PutFiles ` multiple times. Command parameter ` directory/newname `
maps to method parameter ` remotePath ` . You have to [ convert relative paths
to absolute paths ](/eng/docs/library_from_script#paths) .

Switches mapping:

Switch  |  Mapping   
---|---  
` -delete ` |  Value ` true ` ( ` $True ` in PowerShell) for method parameter ` remove ` .   
` -latest ` |  See [ Uploading the most recent file ](/eng/docs/script_upload_most_recent_file) .   
` -resume `  
` -append `  
` -preservetime `  
` -nopreservetime `  
` -permissions `  
` -nopermissions `  
` -transfer `  
` -filemask `  
` -resumesupport `  
` -speed=<kbps> ` |  [ Converting transfer settings scripting switches ](/eng/docs/library_from_script_transfer_settings) to .NET assembly class ` TransferSettings ` .   
` -neweronly ` |  Not supported. Use ` [ Session.SynchronizeDirectories ](/eng/docs/library_session_synchronizedirectories) ` instead.   
  
To emulate the ( [ default ](/eng/docs/scripting#using_scripting) ) ` [ option
batch abort ](/eng/docs/scriptcommand_option#batch) ` mode, call ` [
TransferOperationResult.Check ](/eng/docs/library_operationresultbase) ` on
method’s result. See also [ Capturing results of operations
](/eng/docs/library_session#results) .

_Advertisement_

For example, following script snippet:

    
    
    [cd](https://winscp.net/eng/docs/scriptcommand_cd) /home/martinp
    [lcd](https://winscp.net/eng/docs/scriptcommand_lcd) d:\
    ...
    [put](https://winscp.net/eng/docs/scriptcommand_put) -delete -filemask=*>1M -resumesupport=off *.txt *.xml web/

maps to following [ PowerShell ](/eng/docs/library_powershell) code:

    
    
    $transferOptions = New-Object WinSCP.[TransferOptions](https://winscp.net/eng/docs/library_transferoptions)
    # -filemask=*>1M
    $transferOptions.FileMask = "*>1M"
    # -resumesupport=off
    $transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
    # Absolute paths + $True for -delete + Two calls for two source parameters
    # + calling Check on result to emulate the (default) "option batch abort" mode
    $session.PutFiles("d:\*.txt", "/home/martinp/web/", $True, $transferOption