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.