There is an example in the manual that uses the HTTP PUT method to upload a binary file: HTTP
I guess that it shouldn't be too difficult to convert it to use POST method instead (you will need to first set the content type and length which you can find with FileSize).
It will be a little bit more complicated.
I've found some c# code that deals with this problem: how to upload file via c# code - bytes
I will convert it to Basic4ppc and upload it tomorrow.
That was a long day
I've uploaded a small program based on this code: how to upload file via c# code - bytes
I don't have an account so I get an 'unknown user' error.
Tell me how it went.
Thanks, good example.
I have an account on this site and tried how it works. In response, I receive an error:
<? xml version = "1.0" encoding = "UTF-8"?>
<rsp stat="fail">
<err Code="1002" msg="Image not found" />
</ rsp>
The path to the file checked, all OK.
Then he looked at his request in HttpAnalizer. Although the method is POST, and POST data is empty, and the username and password into the stream.
First let me say that you are very quick in replies etc! You do a great job running this forum and software.
The multipart post solution for Twipic does not work for me, same problem as the other user.
What i'm basically looking for is a generic sample that combines posting fields and a file in one call. Im working on a product that can talk to a whole bunch of web services (POST) and this binary upload stuff frustrates me.
For some services i write my own small PHP wrappers to make it easier but the uploading stuff in combination with input fields I cannot get to run.
This sample has a lot of stuff I don't understand (boundary).
Hope you have a generic sample and maybe even better with Async stuff.
I can help out here, had the same issue with the POST multipart, after some intense network tracing, comparing and reading a couple of RFCs i finally got it to work.
I will post example code here soon, once i've tested everything...
BUT: to send a binary file-stream (picture) , for send over HTTP-POST works
'// ( no more problems with PUT -the samples here I do not bring to work)
when I convert it to ascii - I convert it to longer stream , and ONLY USE PRINTABLE chars
(I was inspirated by JSON ) and tested til 2Megabyte Pictures on desktop , now I will try on my ppc .
in the web I reconvert the POST to binary with php.