Get File
Please see the Get File API reference.
Remove File
If you need to delete files on a node, use this method.
If you are removing a file from the Dashboard's file list,use this method,"http://127.0.0.1:5001/api/v0/files/rm".
API Endpoint
http://localhost:5001/api/v1/rm
Arguments
Argument | Input Values | Type | Description | Required? |
---|---|---|---|---|
arg | Hash of file to be removed from local node. | string | The hash of the file to be removed from the local BTFS node. | Y |
Usage Example
// Remove the file.
curl -X POST "http://localhost:5001/api/v1/rm?arg=QmY6MMQBM2Ewhg537gNPZTcpCQLfQ5mAwaNE4rk3rxfrvN"
Sample Response
// If the file was initally added with Reed-Solomon encoding, the removal results in the chunks being individually removed.
{
"Strings":[
"Removed QmWJSkjahrTPR8AL81k8yxNSfB1VQJw53eH23WuHwvEb8n",
"Removed QmcH8TFbYgU44gC7EHUPZwddpxkZ5QEWXRR5ADByKdLqyR",
"Removed QmdwB3nHsy76W3Ry9knjjsGk9Vt9Jh7bfnKJVRF83LUYtN",
"Removed QmeGeowctj6uJVzBXr54QEeRTi22P53MZLMrPGQHGMrTza",
"Removed QmYK1rHGQR5SDhzYZxcnjHjep3CVURZY4BPUAbFsbmARVC",
"Removed QmQ3xbDCGvmaiom266Go5SppNz1LSWwB4nvVXnGw3sArQu",
"Removed QmSBMXnAZ3ECV8rkNiw5FDt6jKzE9FDe9huLrzQ14cG9Xe",
"Removed QmcLJp9fBUfjZGg72hinTsuaPuXbDT4MHJoU3tBbSmMWgq",
"Removed QmV2uDzKjzo13o7kwomQG3BEJPcXkhwysc1b8UGqjkuhEa",
"Removed QmUp5bQMNSZSUZtTzrf5iPLR5caSAzCFT2Yc2Cwny6yKhB",
"Removed QmbdNBQTxdwtLF1MgKTg23Kk86jqVSVuE9kVMCN8jSKof2",
"Removed QmYtZVxG7v8t1TXaDACCfxDVYr2t1rLgvyGmhxwynSjwzM",
"Removed QmUuoqYg3PLNnqoXmWv4FanRBSRenzjsUHqVinh21cKtBg",
"Removed QmdJWsk9tS27dzgC6QRf1sKujro3SMkXJf6VScENS6Jho6",
"Removed QmRs9w7DKiqq394ZQSWAYLz4U4vh41bC9FeW6w2X9DqawJ",
"Removed QmThjpdWcvX8DPtocjeGn2oo2hxRApog9i4HK5aRQfKuAg",
"Removed QmQXqtuvnGQBisTgKCczF2vmbYdzB8JrgZBrfni8ipekSD",
"Removed QmRqzLVudY76ZhXLE2X8pr1nyTERRy1er8rFiVbZ2m6Zpq",
"Removed QmTzcqjq3H832vvp4Q4DTRy3sqvjMBKTUGguTnXEYg8oBW",
"Removed QmQKK5WGY6wymDFQue7qzz7Df8K92PqWbBoTNMQsY7qP1g",
"Removed QmVYsPsriLAxAg6ssG6rKcXM5zeSDKs4q83eMhkJQv9uHG",
"Removed QmVWtd8xUpt9D2FDmDenT4StcEg4qcQ2xHTP75KqojUwjF",
"Removed QmZ2s259VCnVPbqYomRcpMA8ZonTAdhSKJqaFDoxkKntYk",
"Removed QmXsjsjdYwVgdMX79EKsKuyZcTMf7E4inZoNNfBsfx9nmg",
"Removed QmZUXFBQ44oEg6vxMXTgRETuWtp6APJ1Wuwip4KFTXg5g6",
"Removed QmXjvoTc9FNphNae5BD6az3eTm8kxVwXcfV8Q5CSf4h6s9",
"Removed QmUcsnSe47vbwd3mWwxjptTpXwRMg9VcHJWpv74nD72NE6",
"Removed QmbCcVXUgdiQDtPD2TX2yUxVFj8952MKx6bNuT5e6bjmBT",
"Removed QmfMZ1CxVPHcmsoZsEAdhMxfdVYhAHcY9eqihVL573fQ7V",
"Removed QmTq7i35CcG81bC1p3C8NrAZwkuf3CBqDRScFnimWcNEgF",
"Removed QmZJiBn6HwDucePAnszk6fGY6ExYin4hyXTnKu27opoX7K",
"Removed QmYq5j7hFoPMZgWz8SDLqaGoeaYPoA8PM8ZnciLoa4JVwV",
"Removed QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCf7b"
]
}
// Otherwise, the root file hash is simply removed:
{
"Strings": [
"Removed QmY6MMQBM2Ewhg537gNPZTcpCQLfQ5mAwaNE4rk3rxfrvN"
]
}
Remove File Path
When you remove file in Dashboad file system, should use it.
Like this, "%2F111.pdf" is "/111.pdf", it is file name.
API Endpoint
http://localhost:5001/api/v1/files/rm?recursive=true&arg=%2F111.pdf
Arguments
Argument | Input Values | Type | Description | |
---|---|---|---|---|
recursive | true | bool | Recursive deletion flag, if it is dir. | |
arg | file name with path, in file system | string | need to remove file name with path, in file system |
Usage Example
curl -X POST "http://127.0.0.1:5001/api/v0/files/rm?recursive=true&arg=%2F111.pdf"