ZF-6860: Nirvanix upload fails in command line on Windows

Issue Type: Bug Created: 2009-05-29T11:16:30.000+0000 Last Updated: 2009-09-18T13:23:30.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Barry Ruffner (bruffner) Assignee: Pádraic Brady (padraic) Tags: - Zend_Service_Nirvanix

Related issues: Attachments:


When trying to execute the following script in the Windows command line an exception is thrown due to dirname returning a backslash.

'userforzendbug', 'password' => 'zendpass', 'appKey' => '1a6df3fd-c81d-4cbf-9a97-27110926e916'); $nirvanix = new Zend\_Service\_Nirvanix($auth); $imfs = $nirvanix->getService('IMFS'); $result = $imfs->putContents('/foo.txt', 'fourteen bytes'); print\_r($result); ?> In library/Zend/Services/Nirvanix/Namespace/Imfs.php at line 85:

... $this->_httpClient->setParameterPost('destFolderPath', dirname($filePath)); $this->_httpClient->setFileUpload(basename($filePath), 'uploadFile', $data, $mimeType); $response = $this->_httpClient->request(Zend_Http_Client::POST); ...

The fix is to always pass Nirvanix a forward slash. The replacement for line 85 could be something like a str_replace for the slash.

    $this->_httpClient->setParameterPost('destFolderPath', str_replace("\\", "/", dirname($filePath)));


Posted by Barry Ruffner (bruffner) on 2009-05-29T11:20:14.000+0000

after str_replace(" there should be a backslash backslash but it seems to have been stripped out.

Posted by Pádraic Brady (padraic) on 2009-09-18T13:23:30.000+0000

Fixed in r18283

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.