Downloading files from Dropbox using C# asp.net -


i want download files dropbox using dropbox.api.

my current code is

public static void download(listbox file)     {         file.items.clear();         using (var dbx = new dropboxclient("mytoken"))         {             using (var responses = dbx.files.downloadasync("/pakistan.txt"))                   {            httpcontext.current.response.clear();            httpcontext.current.response.clearheaders();            httpcontext.current.response.clearcontent();            httpcontext.current.response.addheader("content-disposition", attachment; filename=" + responses.result.response.name);            httpcontext.current.response.addheader("content-length", responses.result.response.size.tostring());            httpcontext.current.response.contenttype = "text/plain";            httpcontext.current.response.flush();            httpcontext.current.response.transmitfile(responses.result.response.name);            httpcontext.current.response.end();             }         }     } 

it's downloading file, contents not present in file.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -