简体   繁体   中英

C# download file from dropbox and convert it to HttpPostedFile

My web site has an option to upload files from local computers. I want to now add an option to upload files straight from dropbox. I am using the dropbox chooser api which returns the link for the file chosen by the client.

I then want to download the file to the server and convert it to HttpPostedFile or post it again as a HttpPostedFile - because my functions expect a HttpPostedFile object...

Can somebody help me find a way to do that?

idan.

You need to make your own class that inherits HttpPostedFileBase and implements its methods using the Dropbox API.

You can then pass that class for files from Dropbox, and HttpPostFileWrapper for regular uploads.

If you're using ASP.Net MVC, you will get HttpPostedFileBase directly for regular uploads, and you can create a custom model binder to automatically handle Dropbox too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM