tzyganu / UMC1.9

New Ultimate Module Creator for Magento 1.7 +
MIT License
242 stars 88 forks source link

Any example how to upload file via API? #91

Open bartwind opened 9 years ago

bartwind commented 9 years ago

Hi, are upload file type field by API working??

$fileb64 = base64_encode(file_get_contents('test.pdf'));

$result = $client->call($sessionId, 'document.add', array( 'document' => array( 'document_name' => 'test api document file', 'name_doc' => 'title of doc', 'file' => array( 'name' => 'testpdf.pdf', 'content' => $fileb64, 'mime' => 'application/pdf' ) ) ));

tzyganu commented 9 years ago

@bartoss77 Unfortunately the generated APi does not allow file uploads yet. It treats the file fields as simple text fields. I will try to make the upload possible in the near future.