Skip to content

AmpyWrapper.Ampy.Upload(string,string)

Finnomator edited this page Aug 3, 2023 · 2 revisions

Ampy.Upload(string, string) Method

Put a file or folder and its contents on the board.

public System.Threading.Tasks.Task Upload(string local, string? remote=null);

Parameters

local System.String

Local file or folder path.

remote System.String

Remote file or folder path.

Returns

System.Threading.Tasks.Task

Example

To upload a main.py from the current directory to the board's root:

await Upload("C:/main.py")  

To upload a board_boot.py from a ./foo subdirectory and save it as boot.py in the board's root:

await Upload("./foo/board_boot.py", "boot.py")  

To upload a local folder adafruit_library and all of its child files/folders as an item under the board's root:

await Upload("adafruit_library")  

To put a local folder adafruit_library on the board under the path /lib/adafruit_library on the board:

await Upload("adafruit_library", "/lib/adafruit_library")  

Clone this wiki locally