Replies: 7 comments 7 replies
-
Fetch API supports file upload, I'll make sample for that. |
Beta Was this translation helpful? Give feedback.
-
Andrew, thanks for your help. Expect to see your sample soon. |
Beta Was this translation helpful? Give feedback.
-
See samples/fetch(AJAX)/test-upload.htm in 4.4.7.4 |
Beta Was this translation helpful? Give feedback.
-
I tried this sample and it's running ok. But I don't understand this statement and I cann't find any document about it.
file1 and comment1 are used in dataToSend as json key. Is it neededy by demo php file? |
Beta Was this translation helpful? Give feedback.
-
I write a sample server using Deno (https://deno.land) : When I use curl to upload file, success. curl -XPOST -F "file=@test-fetch.htm" http://127.0.0.1:3100/upload. |
Beta Was this translation helpful? Give feedback.
-
This in Sciter: let dataToSend = {"file1": file, "comment1": "this is just a test" };
var resp = await fetch("https://sciter.com/test/test-file-receiver.php", {
method: "POST",
body: dataToSend
}); is equivalent of const dataToSend = new FormData();
dataToSend.append('file1',file);
dataToSend.append('comment1',"this is just a test");
const resp = await fetch("https://sciter.com/test/test-file-receiver.php", {
method:'POST',
body:dataToSend
} ); in browsers. If body is an object (map) that contains File objects, Sciter will send |
Beta Was this translation helpful? Give feedback.
-
I tried your sample code, I think Content-Type: multipart/form-data should be sent, but I see is "content-type": "application/x-www-form-urlencoded;" |
Beta Was this translation helpful? Give feedback.
-
My scenario:
Should I use Fetch API or mithril.js. I don't know if mithril.js FileUpload/XHR is workable with Sciter.js.
Beta Was this translation helpful? Give feedback.
All reactions