Coder Social home page Coder Social logo

Comments (7)

jimdoescode avatar jimdoescode commented on June 9, 2024

You can turn on some logging by setting the DEBUG const to true in the library. That will write more detailed information to the default PHP error log.

I just ran some tests and found no issues with the current upload functionality. Would you mind posting your code?

from codeigniter-dropbox-api-library.

fibericon avatar fibericon commented on June 9, 2024

Setting the debug const to true seemed to have no impact on the error text. For my code, I'm using the example controller, with the exception of adding my own keys. Also, in test_dropbox(), I have this, directly after $dbobj = $this->dropbox->account():

var_dump($this->dropbox->add("cards.pdf", getcwd()."/assets/pdf/1.pdf"));

That produces this:

object(stdClass)#18 (1) { ["error"]=> string(9) "Forbidden" }

from codeigniter-dropbox-api-library.

jimdoescode avatar jimdoescode commented on June 9, 2024

The DEBUG flag does not change the error text. It logs debug information to the PHP error log you need to check your log. That said have you tried "/cards.pdf" as the path on the dropbox?

from codeigniter-dropbox-api-library.

fibericon avatar fibericon commented on June 9, 2024

I've tried "/cards.pdf" as well. Here's what that got me in the log:

[06-May-2013 21:07:30] Array
(
[url] => https://api-content.dropbox.com/1/files/dropbox/cards.pdf?file=%2Fhome%2Frebelwar%2Fpublic_html%2Fcards%2Fassets%2Fpdf%2F1.pdf
[content_type] => application/json
[http_code] => 403
[header_size] => 182
[request_size] => 636
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.596009
[namelookup_time] => 0.002087
[connect_time] => 0.039729
[pretransfer_time] => 0.14853
[size_upload] => 26004
[size_download] => 22
[speed_download] => 36
[speed_upload] => 43630
[download_content_length] => -1
[upload_content_length] => 26004
[starttransfer_time] => 0.1883
[redirect_time] => 0
[request_header] => POST /1/files/dropbox/cards.pdf?file=%2Fhome%2Frebelwar%2Fpublic_html%2Fcards%2Fassets%2Fpdf%2F1.pdf HTTP/1.1

Accept: /

Host: api-content.dropbox.com

Connection: close

User-Agent: CodeIgniter

Accept-encoding: identity

Authorization: OAuth oauth_consumer_key="['key removed]", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1367892450", oauth_nonce="192e8ad710a53308b6d39d6a31a9e956", oauth_version="1.0", oauth_token="l32csjssl11na9u", oauth_signature="otUSurC7ap59wv1KdzP%2FTiz6clc%3D"

Content-Length: 26004

Expect: 100-continue

Content-Type: multipart/form-data; boundary=----------------------------82582d314e22

)

[06-May-2013 21:07:30] {"error": "Forbidden"}

from codeigniter-dropbox-api-library.

jimdoescode avatar jimdoescode commented on June 9, 2024

What type of app did you register? Is it "Full Dropbox" or "App Folder"? The DEFAULT_ROOT parameter if you didn't change it is for Full Dropbox. You will need to make sure the DEFAULT_ROOT matches the app type you register.

from codeigniter-dropbox-api-library.

fibericon avatar fibericon commented on June 9, 2024

It was "App folder". Looks like you nailed the problem - switching DEFAULT_ROOT to "sandbox" did the trick. Thanks for the help.

from codeigniter-dropbox-api-library.

Kendysond avatar Kendysond commented on June 9, 2024

Please don't promote your own libraries here. - Jimdoescode

from codeigniter-dropbox-api-library.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.