Skip to content

Commit

Permalink
Fixed extensions disappearing. Updated versions to 1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emzi0767 committed Jun 27, 2017
1 parent c8f6079 commit 71e2605
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 29 deletions.
16 changes: 10 additions & 6 deletions Emzi0767.OwoDotNet.Cli/Emzi0767.OwoDotNet.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' != ''">
<Version>1.0.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.0.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.0.0.$(VersionSuffix)</FileVersion>
<Version>1.1.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.1.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.1.0.$(VersionSuffix)</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' And '$(VersionSuffix)' != ''">
Expand All @@ -35,4 +35,8 @@
<ProjectReference Include="..\Emzi0767.OwoDotNet\Emzi0767.OwoDotNet.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>
7 changes: 0 additions & 7 deletions Emzi0767.OwoDotNet.Cli/Properties/launchSettings.json

This file was deleted.

12 changes: 6 additions & 6 deletions Emzi0767.OwoDotNet.Tests/Emzi0767.OwoDotNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' != ''">
<Version>1.0.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.0.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.0.0.$(VersionSuffix)</FileVersion>
<Version>1.1.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.1.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.1.0.$(VersionSuffix)</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions Emzi0767.OwoDotNet/Emzi0767.OwoDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' != ''">
<Version>1.0.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.0.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.0.0.$(VersionSuffix)</FileVersion>
<Version>1.1.0-git-$(VersionSuffix)</Version>
<AssemblyVersion>1.1.0.$(VersionSuffix)</AssemblyVersion>
<FileVersion>1.1.0.$(VersionSuffix)</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 12 additions & 4 deletions Emzi0767.OwoDotNet/OwoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public OwoClient(OwoConfiguration config)
Path = POMF_UPLOAD
};
this.UploadEndpoint = ub.Uri;

// create the shorten URI
ub = new UriBuilder(this.ApiBaseUri)
{
Expand Down Expand Up @@ -128,6 +128,11 @@ public async Task<OwoResponse> UploadFileAsync(Stream s, string filename)
if (dl > 80 * 1024 * 1024 || dl < 0)
throw new ArgumentException("The data needs to be less than 80MiB and greather than 0B long.");

var b64data = new byte[8];
var rnd = new Random();
for (var i = 0; i < b64data.Length; i++)
b64data[i] = (byte)rnd.Next();

var get_args = new Dictionary<string, string>
{
["key"] = this.ApiKey
Expand All @@ -136,13 +141,16 @@ public async Task<OwoResponse> UploadFileAsync(Stream s, string filename)
var turl = string.Concat(this.UploadEndpoint, "?", this.MakeQueryString(get_args));

var req = new HttpRequestMessage(HttpMethod.Post, new Uri(turl));
var mpd = new MultipartFormDataContent(string.Concat("upload------", DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss zzz")));
var mpd = new MultipartFormDataContent(string.Concat("---upload-", Convert.ToBase64String(b64data), "---"));

var bdata = new byte[dl];
await s.ReadAsync(bdata, 0, bdata.Length);

var fn = Path.GetFileName(filename);
var sc = new StreamContent(s);
var sc = new ByteArrayContent(bdata);
sc.Headers.ContentType = new MediaTypeHeaderValue(MimeTypeMap.GetMimeType(Path.GetExtension(fn)));

mpd.Add(sc, "files[]", fn);
mpd.Add(sc, "files[]", string.Concat("\"", fn.ToLower(), "\""));

req.Content = mpd;

Expand Down

0 comments on commit 71e2605

Please sign in to comment.