Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API File Create Issues #17

Open
jwhitefl opened this issue Aug 30, 2018 · 1 comment
Open

API File Create Issues #17

jwhitefl opened this issue Aug 30, 2018 · 1 comment

Comments

@jwhitefl
Copy link

Trying to move files from one Marketo instance to another. Marketo support said to use the api. The PHP code for retrieving files and folders works, but when I try to create the file from one marketo instance onto the new one using the api, I get a couldn't open file .... I am providing the file url that I get in response from the rest api for querying files.

@everlyd
Copy link
Collaborator

everlyd commented Aug 31, 2018

Unfortunately, you cannot simply pass an URL to the Create File endpoint. You will need to download the file from source instance, and then upload that file to target instance. Before uploading to target instance, you will likely have to mirror the source folder structure in the target instance (either by hand or by using Create Folder endpoint).

When you upload a file using Create File endpoint, you must use Multipart file semantics. Easiest way to do that is to use CURLFile class (http://php.net/manual/en/class.curlfile.php). If you get it working let us know and we can replace the Create File sample with your code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants