cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

Error with DownloadFile function while using dropPHP

adarsh007 New member | Level 2
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

Re: Error with DownloadFile function while using dropPHP

Dropboxer
Dropboxer

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.

Re: Error with DownloadFile function while using dropPHP

adarsh007 New member | Level 2
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

Re: Error with DownloadFile function while using dropPHP

Dropboxer
Dropboxer
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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?