Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
jary_capstone
8 years agoHelpful | Level 5
Uploading files from a file server to DropBox
I've been adding some code to upload a file from my server to a specific folder in Dropbox but nothing successful. I'm using Yii2 advanced framework. (Php, javascript and html code in it). These are...
- 8 years ago
Based on this code, it looks like you've switched to using this other "Dropbox Uploader" library:
https://github.com/jakajancar/DropboxUploader
We do not recommend using this. From the its own readme:
"Its development was started before Dropbox released their API, and to work, it scrapes their website. So you can and probably should use their API now as it is much more stable."
I recommend using a third party library that actually uses the API, like you were before, or calling the API directly.
Greg-DB
Dropbox Community Moderator
8 years agoFrom the code you provided, it looks like you're using this third party library:
https://github.com/kunalvarma05/dropbox-php-sdk
We can't provide support for third party libaries, as we didn't make them, but we'll be happy to help with any issues you're having with the Dropbox API itself.
Whenever you make a Dropbox API call, you should receive a response indicating if the call succeeded or failed. It sounds like you're having trouble uploading to Dropbox. What does the 'upload' method return or throw?
jary_capstone
8 years agoHelpful | Level 5
I can change the code from third party to the official Dropbox Api.
What I want to do is to select the file that I want to upload and click the Save/Upload button to save it in Dropbox in a specific folder directory.
The upload method that I have right now is not throwing any error. It works as if it's uploading the file but it returns to the same page without any warning or flash message.
- Greg-DB8 years ago
Dropbox Community Moderator
If the method is not throwing an error, what is it returning? (I.e., `$uploadedFile` in your code #1, or `$file` in your code #2.)`
- jary_capstone8 years agoHelpful | Level 5
$uploadedFile in code #1.
It seems the variable is not taking the file that I selected so the variable is coming empty.
- Greg-DB8 years ago
Dropbox Community Moderator
I'm not sure I understand what you mean when you say "the variable is not taking the file that I selected".
Do you mean $uploadedFile is null after the upload method runs? It sounds like the method didn't successfully run. You may need to debug your code more, or double check if you're getting any other output or error.
About Discuss Dropbox Developer & API
Make connections with 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!