Subfolders and TAdvDropBox

I need to be able to upload files using a specific folder structure. So if the folders are already in place I can grab the location I need and upload the file, otherwise I must first create the folders and then upload the file to the correct location. Using GetFolderInfo for folders located at the root level works fine, but I don't see how to get the folder location I need for a subfolder. Here's a code sample from a simple test program (not working correctly) I'm using C++ Builder XE4 and the demo version of your cloud components.


TCloudItem *CompanyFolder = NULL;
TDropBoxItem *FolderTest = NULL;
FolderTest = AdvDropBox1->GetFolderInfo("01");
if(FolderTest == NULL)
    CompanyFolder = AdvDropBox1->CreateFolder(NULL, "01"); // Root level
else
    delete FolderTest;
FolderTest = NULL;
FolderTest = AdvDropBox1->GetFolderInfo("01/TECH"); // Not working
if(FolderTest == NULL)
{
    AdvDropBox1->CreateFolder(CompanyFolder, "TECH");
    FolderTest = AdvDropBox1->GetFolderInfo("01/TECH");
}
TDropBoxItem *WorkOrderIn = AdvDropBox1->Upload(FolderTest, "C:\\Users\\Public\\Documents\\test.in");


Try:


FolderTest = AdvDropBox1->GetFolderInfo("01\TECH"); 

Sorry that doesn't work either. When I use:

FolderTest = AdvDropBox1->GetFolderInfo("01\TECH");

FolderTest is set to NULL. (And yes the folders DO exist).

There must be a proper way to get a pointer to a subfolder!

I cannot reproduce a problem here. If the folder "01/TECH" exists on the DropBox account, the function AdvDropBox1->GetFolderInfo("01/TECH");  returns a valid TDropBoxItem object here.

Did you verify that "01/TECH" was effectively created and/or exists?



I reworked my code a little, and you are correct - that seems to be working now, so it was probably my mistake. Do subfolders always have to be referenced from the root position? Is there a way to essentially set the current directory, so they can be referenced by their name only?

Everything is referenced from the root.