frappe-client icon indicating copy to clipboard operation
frappe-client copied to clipboard

add methods to GET/PUT file attachments

Open jevonearth opened this issue 9 years ago • 6 comments

frappe-client doesn't have methods to fetch attachments for a given document. The meta data is available using get_doc as shown below.

    return wn.get_doc(
            'File Data',
            filters=[
                ['File Data', 'attached_to_doctype', '=', doctype],
                ['File Data', 'attached_to_name', '=', docname]],
            fields=['name','file_name','file_url', 'file_size'])

Methods to fetch and post attachments would be very useful.

jevonearth avatar Oct 05 '15 16:10 jevonearth

@jevonearth, do you need this? I can release in https://github.com/frappe/frappe-client/pull/12

MaxMorais avatar Mar 07 '16 15:03 MaxMorais

Oh yes, this will be super helpful. Thanks @MaxMorais !

jevonearth avatar Mar 07 '16 15:03 jevonearth

@jevonearth, can you describe the functions that do you need?

Attachment upload Attachment download Attachment delete

Other?

MaxMorais avatar Mar 07 '16 15:03 MaxMorais

Can't think of any, I think we can already list attachments.

If there are many attachments, do you favour that the caller just requests each by iterating on the attachment list?

jevonearth avatar Mar 07 '16 18:03 jevonearth