Hi,
I have a PHP code that generates a CSV file, and then I automatically upload this CSV file to my Dropbox.
The first time I run my code, it works and sends the file to Dropbox.
If I rerun the CSV export immediately, it won't send the file to Dropbox.
If I modify my data and rerun the CSV export, it sends the file to Dropbox.
I assume that when it doesn't send the file, it's because no data has been modified, so the file size remains the same, and it doesn't send it?
I want it to send the file to Dropbox even if the file seems identical. Here's the code for my upload using the kunalvarma05-dropbox-php-sdk API:
function uploadFileToDropbox($localFilePath, $fileName) {
$dropbox = initializeDropbox();
$dropboxPath = DROPBOX_BASE_PATH . $fileName;
$dropboxFile = new DropboxFile($localFilePath);
$options = [
'autorename' => false,
'mode' => 'overwrite'
];
return $dropbox->upload($dropboxFile, $dropboxPath, $options);
}