is there a simple example recipe of a file upload ...
# ktor
b
is there a simple example recipe of a file upload server? couldn't find any good examples.
b
I tried that before posting here. I am getting this error while trying to upload files. 2018-03-15 111226.195 [nettyCallPool-4-1] ERROR ktor.application - 200 OK: POST - /api/files/new java.io.IOException: Multipart preamble/prologue limit of 8192 bytes exceeded at io.ktor.http.cio.MultipartKt.copyUntilBoundary(Multipart.kt:211) at io.ktor.http.cio.MultipartKt$copyUntilBoundary$1.doResume(Multipart.kt)
import requests import json url = 'http://localhost:8080/api/files/new' f = open('/home/betterclever/Pictures/rusty.png', 'rb') files = {'file': f} response = requests.post(url, files, headers = { 'Content-Type': 'multipart/related; boundary=???' }) print(response)
I am using above code to make request. I suspect my request is not well formed. Please guide.