DeQmaTech.MediafireSDK 2.0.9

dotnet add package DeQmaTech.MediafireSDK --version 2.0.9                
NuGet\Install-Package DeQmaTech.MediafireSDK -Version 2.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeQmaTech.MediafireSDK" Version="2.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeQmaTech.MediafireSDK --version 2.0.9                
#r "nuget: DeQmaTech.MediafireSDK, 2.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DeQmaTech.MediafireSDK as a Cake Addin
#addin nuget:?package=DeQmaTech.MediafireSDK&version=2.0.9

// Install DeQmaTech.MediafireSDK as a Cake Tool
#tool nuget:?package=DeQmaTech.MediafireSDK&version=2.0.9                

Features:

  • Assemblies for .NET 4.5.2 and .NET Standard 2.0 and .NET Core 2.1
  • Just one external reference (Newtonsoft.Json)
  • Easy installation using NuGet
  • Upload/Download tracking support
  • Proxy Support
  • Upload/Download cancellation support

List of functions:

Authentication

  • Get10MinToken
  • Get2YearToken

Account

  • GetActionToken
  • RevokeActionToken
  • UserInfo
  • SpaceQuota
  • UserSettings
  • RenewToken
  • RenewToken

Files

  • Copy
  • Delete
  • Metadata
  • Move
  • Trash
  • DownloadAsZip
  • GetDownloadUrlAsZip

File

  • Copy
  • Delete
  • Metadata
  • Move
  • Rename
  • ReplaceWith
  • Trash
  • Update
  • Download
  • DownloadLarge
  • DownloadAsStream

Folders

  • Copy
  • Delete
  • Move
  • Trash
  • DownloadAsZip
  • GetDownloadUrlAsZip

Folder

  • Copy
  • Create
  • Delete
  • Exists
  • ListFiles
  • ListFolders
  • Metadata
  • Move
  • Rename
  • Search
  • Trash
  • GetFileMetadataByFilename
  • GetFolderMetadataByFoldername

RecycleBin

  • Empty
  • ListFiles
  • ListFolders

Root

  • GetRootID
  • ListFiles
  • ListFolders
  • Search
  • ListPrivateFiles
  • ListPrivateFolders
  • ListPublicFiles
  • ListPublicFolders

Share

  • ChangeFilePrivacy
  • ChangeFolderPrivacy
  • GetFileLinks
  • GetFileOneTimeUseUrl
  • GetFilesLinks
  • ListPrivateFiles
  • ListPrivateFolders
  • ListPublicFiles
  • ListPublicFolders

Data

  • File
  • Files
  • Folder
  • Folders
  • Root
  • ResizeDirectImageUrl
  • DownloadFile

CodeMap:

codemap

Code simple:

''get session token
Dim tkn = Await MediafireSDK.Authentication.Get10MinToken("user", "pass")

''set client without proxy settings
Dim client As MediafireSDK.IClient = New MediafireSDK.MClient(tkn.response.session_token, "user", "pass", Nothing)
''set client with proxy settings
'Dim client As MediafireSDK.IClient = New MediafireSDK.MClient(tkn.response.session_token, "user", "pass", New MediafireSDK.ConnectionSettings With {.CloseConnection = True, .TimeOut = TimeSpan.FromMinutes(80), .Proxy = New MediafireSDK.ProxyConfig With {.SetProxy = True, .ProxyIP = "127.0.0.1", .ProxyPort = 80, .ProxyUsername = "user", .ProxyPassword = "123456"}})


''Account
Await client.Account.GetActionToken(ActionTypeEnum.upload)
Await client.Account.RenewToken
Await client.Account.RenewToken("session_token")
Await client.Account.RevokeActionToken("action_token")
Await client.Account.SpaceQuota
Await client.Account.UserInfo
Await client.Account.UserSettings

''RecycleBin
Await client.RecycleBin.Empty
Await client.RecycleBin.ListFiles
Await client.RecycleBin.ListFolders

''Share
Await client.Share.ChangeFilePrivacy("file_id", PrivacyEnum.private)
Await client.Share.ChangeFolderPrivacy("folder_id", PrivacyEnum.public)
Await client.Share.GetFileLinks("file_id", LinkTypeEnum.direct_download)
Await client.Share.GetFileOneTimeUseUrl("file_id", True, Nothing)
Await client.Share.GetFilesLinks(New List(Of String) From {{"file_id"}, {"file_id"}}, LinkTypeEnum.direct_download)
Await client.Share.ListPrivateFiles("folder_id")
Await client.Share.ListPrivateFolders("folder_id")
Await client.Share.ListPublicFiles("folder_id")
Await client.Share.ListPublicFolders("folder_id")

Dim CancelToken As New Threading.CancellationTokenSource()
Dim _ReportCls As New Progress(Of MediafireSDK.ReportStatus)(Sub(r) Button1.Text = $"{r.BytesTransferred}/{r.TotalBytes} - {r.ProgressPercentage} <{If(r.TextStatus, "Downloading...")}>")

''File
Await client.Data.File("file_id").Copy("folder_id")
Await client.Data.File("file_id").Delete
Await client.Data.File("file_id").Download("C:\downloads", "rawFile.rar", _ReportCls, CancelToken.Token)
Await client.Data.File("file_id").DownloadAsStream(_ReportCls, CancelToken.Token)
Await client.Data.File("file_id").DownloadLarge("C:\downloads", "rawFile.rar", _ReportCls, CancelToken.Token)
Await client.Data.File("file_id").Metadata
Await client.Data.File("file_id").Move("folder_id")
Await client.Data.File("file_id").Rename("new name")
Await client.Data.File("file_id").ReplaceWith("file_id")
Await client.Data.File("file_id").Trash
Await client.Data.File("file_id").Update("C:\rawFile.rar", UploadTypes.FilePath, "rawFile.rar", _ReportCls, CancelToken.Token)

''Files
Await client.Data.Files(New String() {"file_id1", "file_id2"}).Delete
Await client.Data.Files(New String() {"file_id1", "file_id2"}).Copy("folder_id")
Await client.Data.Files(New String() {"file_id1", "file_id2"}).DownloadAsZip("C:\downloads", "rawFile.rar", _ReportCls, CancelToken.Token)
Await client.Data.Files(New String() {"file_id1", "file_id2"}).GetDownloadUrlAsZip
Await client.Data.Files(New String() {"file_id1", "file_id2"}).Metadata
Await client.Data.Files(New String() {"file_id1", "file_id2"}).Move("folder_id")
Await client.Data.Files(New String() {"file_id1", "file_id2"}).Trash

''Folder
Await client.Data.Folder("folder_id").Copy("folder_id")
Await client.Data.Folder("folder_id").Create("folder name", False)
Await client.Data.Folder("folder_id").Delete
Await client.Data.Folder("folder_id").Exists("folder_name")
Await client.Data.Folder("folder_id").GetFileMetadataByFilename("file_name", False)
Await client.Data.Folder("folder_id").GetFolderMetadataByFoldername("folder_name", False)
Await client.Data.Folder("folder_id").ListFiles
Await client.Data.Folder("folder_id").ListFolders
Await client.Data.Folder("folder_id").Metadata
Await client.Data.Folder("folder_id").Move("folder_id")
Await client.Data.Folder("folder_id").Rename("folder name")
Await client.Data.Folder("folder_id").Search("emy")
Await client.Data.Folder("folder_id").Trash

''Folders
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).Delete
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).Copy("folder_id")
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).DownloadAsZip("C:\downloads", "rawFile.rar", _ReportCls, CancelToken.Token)
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).GetDownloadUrlAsZip
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).Move("folder_id")
Await client.Data.Folders(New String() {"folder_id1", "folder_id2"}).Trash

''Root
Await client.Data.Root.ListFiles
Await client.Data.Root.ListFolders
Await client.Data.Root.ListPrivateFiles
Await client.Data.Root.ListPrivateFolders
Await client.Data.Root.ListPublicFiles
Await client.Data.Root.ListPublicFolders
Await client.Data.Root.Search("emy")


Dim link = (Await client.Share.GetFileLinks("file_id", LinkTypeEnum.direct_download)).response.links(0).direct_download
Await client.Data.DownloadFile(link, "C:\downloads", "rawFile.rar", _ReportCls, CancelToken.Token)
Dim imgLink = (Await client.Data.File("file_id").Metadata).response.file_info.ImgUrl
client.Data.ResizeDirectImageUrl(imgLink, ImageResizeEnum._107x80)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.9 599 4/14/2020
2.0.8 527 1/15/2020
2.0.4 530 9/10/2019
2.0.2 505 9/9/2019
2.0.1 503 9/3/2019
2.0.0 520 8/27/2019