Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

adarsh007's avatar
adarsh007
New member | Level 2
8 years ago

Error with DownloadFile function while using dropPHP

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    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's avatar
    adarsh007
    New member | Level 2
    8 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    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.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!