cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error with DownloadFile function while using dropPHP

Error with DownloadFile function while using dropPHP

adarsh007
New member | Level 2

I tried executing my php code to download a file from dropbox using dropboxclient.php which shows the below error.  The given Download file function works perfectly fine with windows but not with macbook. Can anyone help me in solving the issue.

 

Myphpcode For download function:

if(isset($_GET['disp']))

    {

        $test_file = $_GET['disp'];

        $dropbox->DownloadFile( '/'.$_GET['disp'], $test_file );

    }

 

<?php

    $files= $dropbox->GetFiles("",false);

    foreach ($files as $value) {

        ?>

 

<a href="album.php?disp=<?= basename($value->path) ?>"><?= basename($value->path)?></a>

 

<?php

    }

    ?>

 

Fatal error:  Uncaught DropboxException: Could not create file image2.jpeg ! in /Applications/XAMPP/xamppfiles/htdocs/project8/DropboxClient.php:278
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/project8/album.php(109): DropboxClient->DownloadFile('/image2.jpeg', 'image2.jpeg')
#1 {main}
  thrown in /Applications/XAMPP/xamppfiles/htdocs/project8/DropboxClient.php on line 278

 

 

3 Replies 3

Greg-DB
Dropbox Staff

That library is made by a third party, so we can't provide support for it, and the error here doesn't seem to be coming from the Dropbox API itself. You may want to open an issue for the library instead.

 

For reference though, that error seems to come from this line. That indicates an issue openining the local destination path. I recommend checking that you have the correct path, and permissions to that path.

adarsh007
New member | Level 2

Well Thanks a lot Mr.Greg. I have even tried changing the permission for the folder and execute it.. It still gives the same error. COming to the destination path i suppose it takes the home directory automatically when i give the file name coz it worked in Windows like that. 

 

If that's not the case could you plese suggest how a destination path needs to be given for that DownloadFile() function.

 

Thanks in advance

Greg-DB
Dropbox Staff
Unfortunately, as that's related to using the local filesystem, via a third party library, and not the Dropbox API itself, I'm afraid I can't offer insight there.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    adarsh007 New member | Level 2
What do Dropbox user levels mean?