POS_Sprint_2 #4

Merged
s426229 merged 12 commits from POS_Sprint_2 into develop 2020-12-14 19:27:10 +01:00
3 changed files with 4 additions and 3 deletions
Showing only changes of commit c2c1cfe943 - Show all commits

View File

@ -151,7 +151,7 @@ namespace Klient.Droid
using(var byteArrayContent = new ByteArrayContent(await stramContent.ReadAsByteArrayAsync())) using(var byteArrayContent = new ByteArrayContent(await stramContent.ReadAsByteArrayAsync()))
using(var formDataContent = new MultipartFormDataContent()) using(var formDataContent = new MultipartFormDataContent())
{ {
formDataContent.Add(byteArrayContent, "file", Guid.NewGuid() + ".jpg"); formDataContent.Add(byteArrayContent, "image", Guid.NewGuid() + ".jpg");
foreach (var content in formDataContent) foreach (var content in formDataContent)
{ {
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(ContentResolver.GetType(photo.Data)); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(ContentResolver.GetType(photo.Data));

View File

@ -15,6 +15,7 @@
android:text="Wyślij zdjęcie" android:text="Wyślij zdjęcie"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/SendPhoto" /> android:id="@+id/SendPhoto"
android:onClick="SendPhoto"/>
</LinearLayout> </LinearLayout>

View File

@ -20,7 +20,7 @@ namespace Serwer.Api.Controllers
} }
[HttpPost("Process")] [HttpPost("Process")]
public async Task<IActionResult> Process(IFormFile image) public async Task<IActionResult> Process([FromForm]IFormFile image)
{ {
if(image == null) if(image == null)
{ {