Hi Thys,
The Server supports parameters in various ways;
a) Form-encoded (ie as if they've come from a browser)
b) XML or JSON
If the request is form-encoded then the File is binary, and is parsed into the StringTheory object as binary.
If the request uses XML or JSON, it is assumed the file is base64 encoded, so it's put into the StringTheory object and converted back to binary for you.
The NetTalk client supports all 3 of these, so you have a few options.
Are you making the client in Clarion with NetTalk?
If so form encoding is the easiest.
client.setvalue('filexx','c:\temp\a.pdf',true)
client.setvalue('filename','a.pdf')
client.post(url,'')
>> I understand that the client will be using a POST call with the file content in the header.
the file content is not really in the header - the file content is in the "Post Data" - encoded as either form-encoded, cml, or json.
>> Therefore there is an equivalent StringTheory parameter that will receive the content.
yes, the content is moved into a StringTheory object for you (and converted to binary if necessary.)
>> Do I then need to use p_web.SaveFile in the ServiceMethod to save the file?
no, you'd use the StringTheory.SaveFile method.
p_web.SaveFile is for a different place.
>> Will the default location be the uploads folder?
no. You are expected to pass a "full path name" - if you only pass a simple filename then it will go to the "current directory" whereever that may be set to (and that's not ideal, so set a full pathname.)
If you want it to go to the uploadsfolder (*) then you can use
p_web.site.uploadspath
(*) Do you want it to go to uploads? Files in uploads can be downloaded directly by a browser, not necessarily using your API, so may not be what you want to do.
Cheers
Bruce