PHP en AMS

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
La cuestion es que estoy creando un proyecto...

Necesito crear una funcion para subir archivos a mi Dropbox, buscando por la red encontre un Ejemplo en PHP para subir los archivos pero no se como adecuar este ejemplo a AMS.

Aqui esta el link

http://www.ampercent.com/downloads/dupass.rar

-------------
Si alguien me puede ayudar se lo agradeceria..
Aqui algunos links de interes sobre este tema:

http://ampercent.com/projects/du/

http://wiki.dropbox.com/DropboxAddons/P ... oxUploader
http://jaka.kubje.org/projects/dropbox-uploader/
te dejo un par de ejemplos:

Desktop.rar (30.91 KB)
http://www.multiupload.com/8U4GLXY8H2
Thanks
Dropbox tiene un api publico para gestionar archivos, googleando un poquito he encontrado esto

http://sharpbox.codeplex.com/

Es una integración de este api a c# necesitas generar el api-key e indicarlo mediante unos pocos parametros, y poder subir bajar o listar archivos sin ningun problema de hecho si te bajas el sharpbox trae un ejemplo compilado para la gestion de una cuenta, solamente necesitariamos exportarlo a dll y usarlo como cualquier otro
Esto es una idea que hace tiempo que queria hacer ,pero no se ni como empezar XD
Le he echado un vistazo y me he sacado un api key (esta en dropbox>developers>new app) Luego he visto una implementación mucho mejor que se llama dropnet

Viene con un archivo de pruebas y estos son los resultados y metodos que ofrece

Imagen

Ademas parece muy muy facil de usar, esta muy bien documentado y compartimentado y viene con ejemplos muy buenos

Haber si alguno se anima y le enseño

DropNetClient _client;
_client = new DropNetClient("apikey", "secretkey");
_client.Login("email", "password");

//subir archivo
_client.UploadFile("/", localFile.Name, content);

//borrar
_client.Delete("/Test.txt");

//obetener lista de archivos
var metaData = _client.GetMetaData("/Public");
//metadata.Contents.Count; metadata.Contents[1-...-x]

//descargar
var file = _client.GetFile("/Getting Started.rtf");
//salvar con un stream por ejemplo o string.fromascii...
le he hechado un ratito y lo llevo bastante bien

using System;
using System.Collections.Generic;
using System.Text;
using RGiesecke.DllExport;
using DropNet;
using System.IO;
using RestSharp;

namespace DropBoxAPI
{
internal static class UnmanagedExports
{
[DllExport("CanLogin", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static bool CanLogin(string apikey, string secretkey, string username, string password)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
var user = _client.Login(username, password);
if (user == null)
{
return true;
}
else
{
return false;
}
}



[DllExport("Upload", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static void Upload(string apikey, string secretkey, string username, string password, string file, string path)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
FileInfo ffile = new FileInfo(file);
byte[] content = _client.GetFileContentFromFS(ffile);
_client.UploadFile(path, ffile.Name, content);

}

[DllExport("UploadAsync", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static void UploadAsync(string apikey, string secretkey, string username, string password, string file, string path)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
FileInfo ffile = new FileInfo(file);
byte[] content = _client.GetFileContentFromFS(ffile);
_client.UploadFile(path, ffile.Name, content);
_client.UploadFileAsync(path, ffile.Name, content, Can_Upload_File_Async_Callback);

}

static void Can_Upload_File_Async_Callback(RestSharp.RestResponse response)
{

}

[DllExport("Delete", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static void delete(string apikey, string secretkey, string username, string password, string file)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
_client.Delete(file);

}

[DllExport("CreateFolder", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static void createfolder(string apikey, string secretkey, string username, string password, string path)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
_client.CreateFolder(path);

}

[DllExport("GetMetaData", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static string getmetadata(string apikey, string secretkey, string username, string password, string path)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
var md = _client.GetMetaData(path);
string retorno="";
for (int i = 0; i < md.Contents.Count; i++)
{
if (i == 0)
{
retorno += md.Contents.Name;
}
else
{
retorno += "|" + md.Contents.Name;
}

}
return retorno;
}


[DllExport("GetFile", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static string getfile(string apikey, string secretkey, string username, string password, string path)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
var fs = _client.GetFile(path);
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
string str = enc.GetString(fs);
return str;
}

[DllExport("GetFileSave", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static void getfilesave(string apikey, string secretkey, string username, string password, string path, string save)
{
DropNetClient _client;
_client = new DropNetClient(apikey, secretkey);
_client.Login(username, password);
var fs = _client.GetFile(path);

var writeStream = new FileStream(save, FileMode.Create, FileAccess.Write);

writeStream.Write(fs, 0, fs.Length);
writeStream.Close();

}



}
}
que tienes pensado una dll de c#?
Me interesa el tema
el caso es que lo he hecho y funciona bien pero por algun motivo no se recibir el contenido de un archivo a la hora de descargarlo, todo lo demas funciona perfectamente... nose luego le echare un vistazo y subo algo...
yeah^^^ :num1: :num1: :num1: :num1: :num1:
esperando.... , me gustaria hacer una app relaccionada con esto
Gracias Pabloko de verdad eres el Mejor!!