Looking for a way to upload to a Dropbox from a ASP contact page

I have an old site "ASP" based that I need to add a contact or upload page to that will allow users to automatically upload to my dropbox.  Has anyone seen this done?
examples or tools would be great...

Matt PinkstonEnterprise ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I have looked at this but never went through with it.   The api's can be done in any language although we may have to work a little because the samples are in other languages.


What I would suggest is creating the functions needed on a separate php page, then use that php page like a webservice call.  I think that will be a lot easier.  Otherwise, we can probably figure this out in just asp/vb but it would mean getting  oAuth2 code for classic asp and I have only seen oAuth so far.

In the datastore api there is a javascript sdk and that can work probably with ajax calls.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
This is the php api for uploading https://www.dropbox.com/developers/core/start/php 


# Include the Dropbox SDK libraries
require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;

$appInfo = dbx\AppInfo::loadFromJsonFile("INSERT_PATH_TO_JSON_CONFIG_PATH");
$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");

$authorizeUrl = $webAuth->start();

echo "1. Go to: " . $authorizeUrl . "\n";
echo "2. Click \"Allow\" (you might have to log in first).\n";
echo "3. Copy the authorization code.\n";
$authCode = \trim(\readline("Enter the authorization code here: "));

list($accessToken, $dropboxUserId) = $webAuth->finish($authCode);
print "Access Token: " . $accessToken . "\n";

$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();


$f = fopen("working-draft.txt", "rb");
$result = $dbxClient->uploadFile("/working-draft.txt", dbx\WriteMode::add(), $f);

$folderMetadata = $dbxClient->getMetadataWithChildren("/");

$f = fopen("working-draft.txt", "w+b");
$fileMetadata = $dbxClient->getFile("/working-draft.txt", $f);

Open in new window

I believe from here we can simply post the file location to the php and have the php page give us a response back.  Then the code above would just need a few slight modifications and there are some good php folks here we can get to help.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Matt PinkstonEnterprise ArchitectAuthor Commented:
excellent thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.