Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
chgeuer committed Jul 17, 2014
1 parent 8f1980c commit ed0fd97
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 26 deletions.
20 changes: 16 additions & 4 deletions App.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /></startup></configuration>
26 changes: 15 additions & 11 deletions LargeFileUploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,38 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<Reference Include="Microsoft.Data.Edm, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.Data.Edm.5.6.1\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
<Reference Include="Microsoft.Data.OData, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.Data.OData.5.6.1\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.Data.Services.Client.5.6.1\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=3.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WindowsAzure.Storage.3.0.2.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
<HintPath>packages\WindowsAzure.Storage.4.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Newtonsoft.Json.6.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
<HintPath>packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Services.Client" />
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
<Reference Include="System.Spatial, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\System.Spatial.5.6.1\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
Expand Down
1 change: 1 addition & 0 deletions LargeFileUploaderUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static async Task UploadAsync(this FileInfo file, CloudStorageAccount sto
var allBlockInFile = Enumerable
.Range(0, 1 + ((int)(fileLength / NumBytesPerChunk)))
.Select(_ => new BlockMetadata(_, fileLength, NumBytesPerChunk))
.Where(block => block.Length > 0)
.ToList();
var blockIdList = allBlockInFile.Select(_ => _.BlockId).ToList();

Expand Down
10 changes: 5 additions & 5 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Program
static void Main(string[] args)
{
LargeFileUploaderUtils.Log = Console.Out.WriteLine;
LargeFileUploaderUtils.NumBytesPerChunk = 512 * 1024;

// LargeFileUploaderUtils.NumBytesPerChunk = 1 * 1024;
LargeFileUploaderUtils.UploadAsync(
inputFile: @"C:\Users\chgeuer\format504015.mp4",
storageConnectionString: "DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==",
containerName: "dummy1",
inputFile: @"C:\Users\chgeuer\github\chgeuer\AzureLargeFileUploader\bin\Debug\LargeFileUploader.exe",
storageConnectionString: Environment.GetEnvironmentVariable("AZURE_STORAGE_CONNECTION_STRING"),
containerName: "dummy222222",
uploadParallelism: 2).Wait();
}
}
Expand Down
12 changes: 6 additions & 6 deletions packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Edm" version="5.6.1" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.1" targetFramework="net451" />
<package id="Microsoft.Data.Services.Client" version="5.6.1" targetFramework="net451" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net40" requireReinstallation="True" />
<package id="System.Spatial" version="5.6.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="3.0.2.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net451" />
<package id="System.Spatial" version="5.6.1" targetFramework="net451" />
<package id="WindowsAzure.Storage" version="4.1.0" targetFramework="net451" />
</packages>

0 comments on commit ed0fd97

Please sign in to comment.