Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
annahernandez99
5 years agoExplorer | Level 4
Dropbox API with PHP get content of file in Dropbox
I have a WebApp that stores a backup in the cloud of the user. I use the third party libary: http://fabi.me/en/php-projects/dropphp-dropbox-api-client/
I think Login works. But im stuck at the point where I can download it.
The following code downloads the file on the cloud and writes it to a file.
$dropbox->DownloadFile( $file, $test_file )
But I need the content of the file only in a string and not as file. The data shouldn't be stored.
1 Reply
- Greg-DB5 years ago
Dropbox Community Moderator
When using the Dropbox API to download a file, that is, via /2/files/download, if the call is successful the file data is returned in the response body. Exactly what the client does with that is up to the client.
For example, in this case, it sounds like you're using a third party library to perform the download and that library saves the data from the response body to a local file, but you actually want it in memory as a string. We can't provide support for third party libraries like this, as they're not made by Dropbox. You may want to refer to the documentation for that library to see if it offers an option that does what you want. Otherwise, you may need to instead read the file off the local filesystem.
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!