DeQmaTech.MediafireSDK 2.0.9

.NET Core 2.1 .NET Standard 2.0 .NET Framework 4.5.2
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 Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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 434 4/14/2020
2.0.8 402 1/15/2020
2.0.4 415 9/10/2019
2.0.2 400 9/9/2019
2.0.1 404 9/3/2019
2.0.0 407 8/27/2019