Yeah here's a bit of my code, because I think more people will be looking for this...
Of course I make sure the fileName is nicely formatted first. I do that using this function:
make-a-safe-url It may be for urls, but works great for making sure filenames are formatted correctly as well.
So inside the uploadFile function (in SoapAPI.php) you do this:
Code:
$result = $this->client->submitModel($this->session, $model, null, 'generated-creator');
And you use the function like this...
Code:
$result = $connection->uploadFile($fileName);
if(is_numeric($result)){
$nr = intval($result);
$link = 'https://www.shapeways.com/model/'.$nr.'/'.$fileName.'.html';
}