chickadee » ipfs » writer/file*

writer/file* path #!key name (headers '())procedure
writer/file path #!key name (headers '())procedure
writer/directory* path #!key name (headers '())procedure
writer/directory path #!key name (headers '())procedure
writer/filesystem path #!key test limit dotfiles follow-symlinksprocedure

Convenience procedures to use as the writer given to with-input-from-request.

writer/file can be used to send a single file to the IPFS node. path is the path to the file you want to send, and it must be accessible by the client (this library), not the IPFS node. name is the name of the file to be given to IPFS, that is, the name that IPFS will use to save it. name defaults to the basename of path, and will be URI-encoded before sending to allow for special characters, and in particular /, so that you may send a path. headers is an alist of headers to send for this specific file.

writer/directory can be used to send a single directory to the IPFS node. The arguments of this function are similar to those of writer/file. NOTE: This does not send other files or directories contained in the specified directory, only an empty directory. For sending a file tree read on.

writer/filesystem can be used to send a file tree to the IPFS node. path specifies the path of the root of the tree you want to send. For details on the other parameters see the documentation for find-files of chicken.file.

If neither of these three procedures quite fit your requirements, you can always build yourself the list to pass to with-input-from-request. writer/file* and writer/directory* may prove useful. They're similar to their non-asterisked counterparts, but they return a single entry instead of an entry wrapped in a list (as is expected by with-input-from-request). For an example usage of these see the examples section.