Upload attachment using rest API

Node.js

import fetch from 'node-fetch';

fetch('https://demo.frappecloud.com/', {
    method: 'POST',
    body: new URLSearchParams({
        'cmd': 'uploadfile',
        'doctype': '<<DocType>>',
        'docname': '<<DocName>>',
        'filename': '<<filename>>',
        'filedata': '<<filedata>>',
        'from_form': '1'
    })
});
3 Likes

Got any solution for permission error? I am facing the same issue when I am trying to upload a file where user don’t have any access token at the moment.

@arslanalamkhan there is an option in the system settings which allows a guest user to upload an attachment you can try it…

1 Like