Torna al Thread

Private Function UploadFileFolderSpecific(ByVal FolderName As String) As Boolean Try Dim Service As DocumentsService = New DocumentsService("AppTitle") Service.setUserCredentials(UserName, Password) Dim Authenticator As ClientLoginAuthenticator = New ClientLoginAuthenticator("AppTitle", ServiceNames.Documents, UserName, Password) Dim Entry As DocumentEntry = New DocumentEntry() Entry.Title.Text = "Legal Contract 1.0" Entry.Summary.Text = "Descrizione" Entry.MediaSource = New MediaFileSource("c:\box\Demo.txt", "text/plain") 'Entry.MediaSource = New MediaFileSource("c:\TestWord.pdf", "application/pdf") Dim CreateUploadUrl As Uri = New Uri("https://docs.google.com/feeds/upload/create-session/default/private/full") Dim Link As AtomLink = New AtomLink(CreateUploadUrl.AbsoluteUri) Link.Rel = ResumableUploader.CreateMediaRelation Entry.Links.Add(Link) Entry.Service = Service Dim Upload As ResumableUploader = New ResumableUploader() AddHandler Upload.AsyncOperationCompleted, AddressOf OnDone AddHandler Upload.AsyncOperationProgress, AddressOf OnProgess Upload.InsertAsync(Authenticator, Entry, New Object()) Return True Catch ex As Exception MsgBox("Errore : " + ex.ToString, MsgBoxStyle.Critical, "Errore Upload File sul Server Google") Return False End Try End Function
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5