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...

Thanks
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 

<?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();

print_r($accountInfo);

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

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

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

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.
0
 
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.

https://www.dropbox.com/developers/datastore
https://www.dropbox.com/developers/core

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.
0
 
Matt PinkstonAuthor Commented:
excellent thanks
0
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.