POS-27
This commit is contained in:
parent
7687c54609
commit
c2c1cfe943
@ -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));
|
||||||
|
@ -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>
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user