Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
ronS1
8 years agoExplorer | Level 4
Dropbox API not returning all files
public function __construct(Dropbox $dropbox)
{
$this->api_client = $dropbox->api();
$this->content_client = $dropbox->content();
$this->access_token = session('access_to...
- 8 years agoFor the error you're getting, it looks like you aren't passing in an access token. (I.e., "Bearer" should be followed by the access token.) You'll need to see why that is. It appears you're trying to retrieve it via `session('access_token')`, which apparently isn't working.
Anyway, yes, you can programmatically get an access token for the user using the OAuth 2 app authorization flow:
https://www.dropbox.com/developers/reference/oauth-guide
The documentation for that can be found here:
https://www.dropbox.com/developers/documentation/http/documentation#authorization
By the way, the subject for your post seems to be about another issue. If you're having another problem, please feel free to open another thread with the details.
Greg-DB
Dropbox Community Moderator
8 years agoIt sounds like you are able to retrieve the access token from the API, per your "I can access the token here" comment in your code, and that you're now trying to pass that string between your classes.
Unfortunately as that is more about structuring your app and passing data (in this case a string that has the access token) around your app, I'm afraid I can't offer help, as that's not about the Dropbox API itself.
A more general PHP forum may be of more help for guidance on how to pass around data like this between your classes.
Unfortunately as that is more about structuring your app and passing data (in this case a string that has the access token) around your app, I'm afraid I can't offer help, as that's not about the Dropbox API itself.
A more general PHP forum may be of more help for guidance on how to pass around data like this between your classes.
ronS1
8 years agoExplorer | Level 4
Yeah, Greg, I figured out the problem, I thank you for your help. There is one particular problem I would like to ask for your advice. As I can list all the files present in my dropbox folders how can I upload it directly to a website without downloading the file on my local machine?
I can generate the downloadable link to store it on my local machine, but as per my requirement, I need to grab a hold of the original file(binary) from Dropbox and import it.
Could you please shed some light on this is, it would be of a great help
Much appreciated. Thanks in advance
I can generate the downloadable link to store it on my local machine, but as per my requirement, I need to grab a hold of the original file(binary) from Dropbox and import it.
Could you please shed some light on this is, it would be of a great help
Much appreciated. Thanks in advance
- Greg-DB8 years ago
Dropbox Community Moderator
I believe I just commented on your StackOverflow post:
https://stackoverflow.com/questions/50127717/importing-files-from-dropbox-using-api-v2-to-a-serverweb-to-web
I don't have full context on your app, but there are several ways to get the file data. If the Chooser works for your use case though, that's recommended as it's generally easy to use. You can get the link from the Chooser and use a standard HTPS client to GET the content from the link.- ronS18 years agoExplorer | Level 4The context of my app is to upload a whole Dropbox folder to my website and process the files inside it one by one. I can select multiple files from "chooser", but I'm not able to get hold of the actual folder in which the files reside. Can you please educate me on how a user can select a whole folder from his/her's Dropbox and upload it to my website and then I can process the files inside it.
- Greg-DB8 years ago
Dropbox Community Moderator
If you want an entire folder, you can use the new "folderselect:true" option:
https://www.dropbox.com/developers/chooser
That can only be used with "preview" links, but you can modify those links for raw file access as documented here:
https://www.dropbox.com/help/desktop-web/force-download
For folders, that will give you a zip file. On your server, you can download the zip data, unzip it, and use the resulting files as desired.
About 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!