NAME

Net::CouchDb::Attach - Represent an attachment to a CouchDb document.

SYNOPSIS

Representation of an attachment, this should normally be created via the attach method in Net::CouchDb::Document.

METHODS

new($doc, $name)

add($file)

Add an attachment. The parameter can be either:

  • A filename, which will be opened and attached.

  • A scalar reference, the contents of which will be attached.

  • A file handle, which will be fully read and attached.

uri

Return the URI that this attachment can be found at (as a string).

name

Return the name of this attachment.

get

Return the content of this attachment as a string.

Note this does not use the same LWP::UserAgent object as the Net::CouchDb instance, so any connection cache will not be used.

AUTHOR

David Leadbeater, <dgl at dgl dot cx>

COPYRIGHT & LICENSE

Copyright 2007 David Leadbeater, all rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.