Move rename file directory
  • 18 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Move rename file directory

  • Dark
    Light
  • PDF

Article Summary

Moves the target file to a new location in the filesystem. Can also be used to rename a file by moving it within the same folder.

Input arguments

LabelKeyTypeRequired?DefaultDescription
Source file pathsourcePathString(local-filesystem-reference)YesAbsolute local filesystem path to the source file/directory, including possible filename and extension.
Target file pathtargetPathString(local-filesystem-reference)YesAbsolute local filesystem path to the target file/directory, including possible filename and extension.
Relative target path?relativeTargetPathBooleanYesIf true, Target file path is interpreted as relative to the source path parent folder.
Overwrite target file?overwriteBooleanYestrueIf true, overwrite the target file.

Output arguments

Number of outputs: 2

LabelKeyTypeDescription
FilefileObjectObject representing the moved file at its new location. Empty if a directory was moved.
  • Local path
file.pathStringAbsolute local filesystem path representing the file location on the device, including the filename and extension. On web, this is created via the [`createObjectURL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) method.
  • MIME type
file.mimeTypeStringMIME type of the file, if it could be determined.
  • Name
file.nameStringName of the file in the local filesystem, if applicable. Note that the filename and extension are included in the **Local path** property already.
  • Size
file.sizeNumberSize of the file, in bytes.
  • Created at
file.createdAtStringCreation datetime of the file, if it can be determined.
  • Modified at
file.modifiedAtStringDatetime when the file was last modified, if it can be determined.

Events

No events.

Errors

LabelCodeDescription
Unkown errorunknownThrown if an unknown error occured while moving the file.

Was this article helpful?

What's Next