Base64 is only necessary if you're writing binary (i.e. image) data to a field that expects to store text, like a Textarea field on the lead or a Text my.token.
If your destination is the Design Studio asset library then Drupal would be doing a multipart post (like a standard HTML form post) to the Files API endpoint as spec'd in the docs. (No XML, either!)
But I do question the design of having (as it sounds) two different content repos. Far better is to store the content in one place only, because you will not be keeping these repos in sync (deletion from one side, or direct creation in the Marketo UI, will not be propagated).
Funny you should ask that - it's exactly the problem I'm investigating a solution for.
We have an inherited Drupal 7 site, with a weird process to add resources to the website listings (white papers, case studies, etc). The marketing team enters a new resource in Drupal - which includes a file upload field. This is used to pass the file name as a parameter in the URL of the resource request page which. Yeah... I don't know why it's done that way either.
In turn, the parameter populates a hidden field an embedded Marketo form, so that we can automate sending them the resource they requested.
... then, of course, they have to go upload the file in Marketo, so that the email doesn't give a broken link.
I'm hoping there's a way I can streamline so that, in Drupal when they add a resource listing, the file they upload actually gets passed to Marketo. This way, they don't have to log into two places. Unless I'm overthinking it. We want the pdf files to be sitting in Marketo, not on the site (nor in both places - because, as you observed, that seems silly.
Your thoughts? Please tell me we're overthinking this somehow!
I'm hoping there's a way I can streamline so that, in Drupal when they add a resource listing, the file they upload actually gets passed to Marketo.
This certainly is possible. The file would have to live in Drupal temporarily (even if it were in a hidden PHP-level tempfile instead of in the Drupal Resources proper, it would always have to make a brief stop in the Drupal/PHP world).
Then it would get pushed to the Marketo Design Studio library and the temporary file deleted on success.