Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace %2F with / in encoded filename

  • Loading branch information...
commit 0611223ab574465f21b6130f7bd90dc225f1d330 1 parent 416b17c
@BenExile authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 Dropbox/API.php
View
6 Dropbox/API.php
@@ -101,8 +101,10 @@ public function putFile($file, $path = '', $overwrite = true)
*/
public function getFile($file, $revision = null)
{
- $path = str_replace(' ', '%20', ltrim($file, '/'));
- $call = 'files/' . $this->root . '/' . $path;
+ // rawurlencode the filename, then replace %2F with / for use in URL
+ $encoded = str_replace('%2F', '/', rawurlencode(ltrim($file, '/')));
+
+ $call = 'files/' . $this->root . '/' . $encoded;
$params = array('rev' => $revision);
$response = $this->OAuth->fetch('GET', self::CONTENT_URL, $call, $params);
Please sign in to comment.
Something went wrong with that request. Please try again.