Forum Discussion

Anand_mishra's avatar
Anand_mishra
Explorer | Level 3
9 years ago

File upload process not working on live server

Hi,

 

I have integrate the PHP api of dropbox on localhost. It is working fine. But when host on live server , file upload process not working. download process working fine.

 

Please help regarding this.

 

I have use these code in index.php

 

require 'app/start.php';
require 'app/dropbox_auth.php';
var_dump($client->getAccountInfo());
echo "Test";

echo "</br>";
//-------for download start----
$client->getFile('/select.html',fopen('files/select.html','wb'));

//-------for download end----


//-------for upload start----
        $file = fopen('/files/Koala.jpg','rb');
    $size = filesize('/files/Koala.jpg');
    $client->uploadFile('/Koala.jpg',Dropbox\Writemode::add(),$file,$size); 

1 Reply

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

    How exactly is it failing? What error/output are you getting?

     

    By the way, it looks like you're using the old PHP Core SDK, which uses Dropbox API v1, which is deprecated. You should migrate to API v2 whenever possible.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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!