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 PinkstonAsked:
Who is Participating?
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.
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.
Matt PinkstonAuthor Commented:
excellent thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.