0

I am working on dropboxapi in php and try to check the directory exists or not:

<?php
$Folder = "changed randomly"
    $direxists= 'https://www.dropbox.com/home/salesforce%20documents/Opportunities'.$folder;
if(is_dir($direxists))
{ 
    echo "<br/>(IF) Directory Exists";
}
?>
Nishant
  • 19
  • 8
  • so what's the issue? – prakash tank Jan 12 '17 at 05:45
  • my else block is executing. I have directory on the given path. – Nishant Jan 12 '17 at 05:51
  • if one is creating folders/directories in dropbox account that doesn't mean dropbox is creating physical directories.. May be you should write a functions which checks the dropbox directory URL exists or not.. This might give you a kick start http://stackoverflow.com/questions/2280394/how-can-i-check-if-a-url-exists-via-php – Nishant Solanki Jan 12 '17 at 06:05
  • add slash after `Opportunities` in your path. `$direxists= 'https://www.dropbox.com/home/salesforce%20documents/Opportunities/'.$folder;` – prakash tank Jan 12 '17 at 06:31
  • You're passing in a URL to a private page on the Dropbox site, so this likely isn't going to do what you want. You probably mean to use the actual Dropbox API, e.g., [/2/files/get_metadata](https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata) can be used to check for the existence of particular items. – Greg Jan 12 '17 at 18:09

0 Answers0