Need help with coding a Dropbox downloader.

  • Thread starter Thread starter agarwal pankaj
  • Start date Start date
A

agarwal pankaj

Guest
Hello,

I am writing a C# application that downloads from a shared Dropbox folder using Dropbox API. I am able to access my own account and folders and files. But when I try to access the given link which looks like this:

Dropbox Folder

I get an exception that the path could not be found, but the path exists as I have used the link in the browser to download the files. So, I suspect that it has something to do with the link itself that I keep getting this error.

I have also used WebClient to read the folder and I get a code which contains html and css with JavaScript containing a JSON object. The html looks like this:

<!DOCTYPE html>
<html ng-app="myApp">
<head>
<base href="/">
<title>Dropbox Folder</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="//static.parastorage.com/services/third-party/fonts/Helvetica/fontFace.css">
<link rel="stylesheet" href="styles/index.css"/>
<script src="//static.parastorage.com/services/js-sdk/1.108.0/js/wix-private.min.js"></script>
<script type="text/javascript">
var initialState = {"APP_ID":"14924864-56d5-b94b-060f-cd57bd16cc26","DEFAULT_LANGUAGE":"en","DISPLAY_MODE_FILES":"files","DISPLAY_MODE_FOLDER":"folder","LIST_FULL_WIDTH":1,"LIST_PARTIAL_WIDTH":0,"FOLDER_STYLE_OUTLINE":"outline","FOLDER_STYLE_SOLID":"solid","SIZE_SMALL":"small","SIZE_LARGE":"large","appName":"myApp","origin":"app_settings","widget_origin":"widget","appId":"14924864-56d5-b94b-060f-cd57bd16cc26","AUTH_URL":"https://www.dropbox.com/oauth2/auth...e=token&state=testtoken&force_reapprove=false","APP_KEY":"rn9cfkc30p3l3po","REGISTER_URL":"Login - Dropbox","design":{"folder_row":{"color":"color-8","opacity":0.15},"bread_crumbs":{"color":"color-4","text":"Body-M","fontSize":12,"arrowColor":"color-4"},"number_items":{"color":"color-4","text":"Body-M","fontSize":12},"connected_cloud":{"color":"color-8","text":"Body-M"},"empty_folder_header":{"text":"Body-L","color":"color-5","fontSize":15,"fontWeight":"bold"},"empty_folder_text":{"text":"Body-M","color":"color-4","fontSize":14},"empty_folder_image":{"color":"color-8"},"icon_color":{"name":"iconColor","value":"color-8","opacity":"0.8"},"folder_icon":{"textFont":{"name":"folderIconFont","value":"Body-M","theme":"font_8"},"textColor":{"name":"folderIconColor","value":"color-8"}},"list":{"title":{"textFont":{"name":"ListTitleFont","value":"Body-L","theme":"font_7","startWithSize":20,"maxSize":42},"textColor":{"name":"ListTitleColor","value":"color-5"}},"files_names":{"textFont":{"name":"ListFilesNamesFont","value":"Body-M","theme":"font_8","maxSize":22},"textColor":{"name":"ListFilesNamesColor","value":"color-4"}},"background":{"value":"color-1","name":"listBackgroundColor","opacity":"1"},"border":{"value":"color-5","name":"listBorderColor","opacity":"0.2"},"icons":{"name":"iconsListColor","value":"color-8"}}},"data":{"settings":{"design":{"folder":{"icon_size":"small","style":"outline"},"list":{"show_numbers_of_items":1,"show_preview":1}},"lang":"en","email":{"text":"","show":1},"layout":{"type":"files"},"account":{"folderPath":"[{\"name\":\"Dropbox\",\"path_lower\":\"/\"}]","folder":"OmniScreen","email":"omnicoomniscreen@gmail.com","name":"OmniScreen Omnico","accessToken":"","fullPath":"/omniscreen","connected":1},"title":{"show":1,"text":"OmniScreen"}}}};
initialState.locationParams = document.location.search;
</script>
<style wix-style type="text/css" ng-non-bindable="">
.folderRow::before {
background-color: {{color-8}};
opacity: 0.15;
}
.file-arrow #z-Stroke-2 {
stroke: {{color-4}};
}

.folder-path-text{
font-size: 12px !important;
color: {{color-4}};
{{Body-M}};
}

.items-row {
font-size: 12px !important;
color: {{color-4}};
{{Body-M}};
}

.title {
{{Body-L}};
font-size: 20px;
{{style.ListTitleFont}};
color: {{style.ListTitleColor color-5}};
}
.closeMe .closeMe-fill {
fill: {{style.ListTitleColor color-5}};
}
.folderName {
{{ style.ListFilesNamesFont Body-M}}
color: {{style.ListFilesNamesColor color-4}}
}

.extention , .fileNameNoExtention{
{{ style.ListFilesNamesFont Body-M}}
color: {{style.ListFilesNamesColor color-4}}
}

.items {
font-size: 12px !important;
color: {{color-4}};
{{Body-M}};
}

.ispopup {
background-color: {{style.listBackgroundColor color-1}};
}

.defaultBackground{
background-color: {{style.listBackgroundColor color-1}};
border : 1px solid rgba(0,0,0,0.2) ;
border-color: {{style.listBorderColor}} !important;
}

.previewBorder{
background-color: {{style.listBackgroundColor color-1}};
}

.webui-popover,.previewBorder,.full-screen-connected {
border-color: {{color-5}} ;
border-color: {{style.listBorderColor}} !important;
}
.full-screen-connected {
background-color: {{color-1}};
color: {{color-5}};
}
.divider , .lastDivider {
background-color: {{color-5}} ;
background-color: {{style.listBorderColor}};
}

.mCSB_dragger_bar.inited{
background-color: {{color-5}} !important;
background-color: {{style.listBorderColor}} !important;
}

#mCSB_2_scrollbar_vertical{

}

.webui-arrow {
border-top-color: {{style.listBorderColor color-5}} !important;
}

.arrowIcon .fill-svg, .mobileArrow .fill-svg , .home-icon path{
fill-rule: evenodd;
fill : {{style.iconsListColor color-8}} !important;
}

.downloadFolderIcon .stroke-svg , .downloadFolderIcon path{
stroke : {{style.iconsListColor color-8}};
}

.viewFileIcon .symbol-showComp path{
fill : {{style.iconsListColor color-8}};
}
.closeMe .closeMe-fill {
fill : {{style.iconsListColor color-8}};
}
.folder-path-text:not(.selected-folder){
color : {{style.iconsListColor color-8}};
}

.fileIcon .fill-svg , .folderIcon .fill-svg{
fill: {{style.iconsListColor color-8}};
}

.fileIcon .stroke-svg , .folderIcon .stroke-svg {
stroke: {{style.iconsListColor color-8}};
}

.folderLayoutIconFill .fill-svg , .folderLayoutIconNotFill .fill-svg {
fill: {{style.iconColor color-8}};
}

.folderLayoutIconFill .stroke-svg, .folderLayoutIconNotFill .stroke-svg{
stroke: {{style.iconColor color-8}};
}

.folderTitle{
{{style.folderIconFont Body-M}};
color : {{style.folderIconColor color-8}};
line-height: 1.4em;
}
.connected-cloud path {
stroke: {{color-8}};
}
.connected-cloud path.fill-connected {
fill: {{color-8}};
}
.connected-cloud--text {
{{Body-M}};
}

.empty-folder--header {
{{Body-L}};
color: {{color-5}};
font-size: 15px;
font-weight: bold;
}

.empty-folder--text {
{{Body-M}};
color: {{color-4}};
font-size: 14px;
}

.empty-folder--image svg g{
fill: {{color-8}} !important;
}
</style>
</head>
<body role="application">
<div ng-view class="my-app" tabindex="-1" role="main"></div>
<script src="scripts/bower-index.js"></script>
<script src="scripts/scripts-index.js"></script>
</body>
</html>

But I couldn't find the file name anywhere that I could parse and use WebClient itself to download.

Any ideas or help is greatly appreciated. Thanks in advance for the help.

Continue reading...
 

Similar threads

Back
Top