Hi Folks,

In case anyone is curious, one way to change the upload folder to something other than the root folder under DropBox is to modify the dropbox.php file on line 233 from

$uri = preg_replace("#(^|[^:])//+#", "\\1/","/files/{$root}/{$dbpath}?file={$filename}{$parstr}");

to

$uri = preg_replace("#(^|[^:])//+#", "\\1/","/files/{$root}/Insert/Desired/SubFolder/Path/Here/{$dbpath}?file={$filename}{$parstr}");

I am still not sure if there is a way to do this programatically through the UI but if anyone has thoughts on how I'd love to hear.

Cheers

Comments

-enzo-’s picture

Hello Muir

You appreciation is correct, to do this easy to maintain you can create a extra field in configuration page per user.

If you can do a patch for that I will really appreciate and include in next version.

Regards,

philsward’s picture

When I tried the suggestion from the original issue, it ended up creating a folder inside the folder I wanted to upload to... During testing, I tried to upload to the pre-defined "Photos" folder, so I changed the above code, thinking it would stick it there. Instead, it created /Photos/Photos/myphoto.jpg

However, when I changed the line just above it:

public function add($dbpath, $filepath, array $params = array(), $root='dropbox/Photos')

and added /Photos after $root='dropbox', it uploaded just fine to the pre-defined Photos folder.

Also, if you have some problems after changing the location, make sure you clear your drupal cache.