Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

http 400 file: expecting a file upload #16

Closed
applemate opened this issue Apr 4, 2015 · 2 comments
Closed

http 400 file: expecting a file upload #16

applemate opened this issue Apr 4, 2015 · 2 comments

Comments

@applemate
Copy link

I have a problem trying to add a file to dropbox. The db log says 400 error code. What am I missing here?

This is my code:

    function save_to_dropbox() {

        // http://localhost:8888/mamaohla/test/save_to_dropbox/11109644961428152252_thumb.png
        // adding 11109644961428152252_thumb.png from root/photo/post folder
        // to dropbox root folder

        $thumb = $this->uri->segment(3);
        $path= FCPATH.'photo/post/';
        $filename = $path.$thumb;

        $dbpath = '';

        $params['key'] = $this->config->item('db_app_key');
        $params['secret'] = $this->config->item('db_app_secret');
        $params['access'] = array('oauth_token'=>urlencode($this->session->userdata('oauth_token')),
                                  'oauth_token_secret'=>urlencode($this->session->userdata('oauth_token_secret')));

        $this->load->library('dropbox', $params);

        $obj =$this->dropbox->account();

        // print_r($obj);

        // add thumb to dropbox
        $this->dropbox->add($dbpath, $filename);

    }

And this is dropbox error log

https://www.dropbox.com/s/c5jdlc9wwwyyil1/Screen%20Shot%202015-04-04%20at%208.03.31%20PM.png?dl=0

@jimdoescode
Copy link
Owner

This is similar to another issue someone just posted. I can't replicate it. I saw a thread on another github library where they said updating the PHP version solved it. BenExile/Dropbox#67

@Kendysond
Copy link

Please don't promote your libraries here. -Jimdoescode

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants