问题
First of all, I can properly upload and download files from Dropbox with the PHP api.
This is how I upload files:
// Upload files
$file = fopen("default.png", "rb");
$size = filesize("default.png");
$client->uploadFile("/default.png", Dropbox\WriteMode::add(), $file, $size);
This is how I download files:
// Download Files
$client->getFile("/default.png", fopen("default.png", "wb"));
Is there a api call to delete files from within the folder your app created. For example, my app creates a folder called Crave Crap. Inside, that folder is an image. That user only has access to that image within the folder Crave Crap within their Dropbox account for a short amount of time.
Is this possible?
EDIT - What API am I using? I'm not the best at answering this question. I have been following a video series here. I downloaded the api by using the terminal directly on composer.json.
Composer.json
{
"require": {
"dropbox/dropbox-sdk": "1.1.*"
}
}
Code in Terminal
composer install
回答1:
It looks like you're using the Dropbox PHP Core SDK. To delete a file or folder using that SDK, you can use the delete method.
Using it would look like:
$client->delete("/default.png");
来源:https://stackoverflow.com/questions/34753340/how-to-delete-files-from-dropbox-with-php-api