Uploading a file to owncloud using Restclient and Delphi Xe Seattle
<p>Trying a simple program with using a RestClinet, Request, and response connecting to a an owncloud server.  Althought the List.php works perfectly, I can not get the upload.php to work with </p>

<pre><code>error {"data":{"message":"Unable to set upload directory."},"status":"error"}
</code></pre>

<p>Here is the code I used for both command, just commenting one out,</p>

<pre><code>//Restclient1.BaseURL :=      'https://server.edu/owncloud/index.php/apps/files/ajax/list.php';
Restclient1.BaseURL := 'https://server.edu/owncloud/index.php/apps/files/ajax/upload.php';
RESTResponseDataSetAdapter1.AutoUpdate := false;          
upload_stream := TFileStream.Create('c:\users\me\test.txt',fmOpenRead);  
upload_stream.Position := 0;
RESTRequest1.Params.AddHeader('Content-Type', 'text/plain');
RESTRequest1.ClearBody;                                     
RESTRequest1.AddBody(upload_stream,TRESTContentType.ctTEXT_PLAIN);
RESTRequest1.Execute;
jValue:=RESTResponse1.JSONValue;
Memo1.Text:= jValue.ToString;
</code></pre>

<p>The code for upload.php states that if no directory is specified, user defualt directory in used.
<a href="https://github.com/Insiteo/owncloud-core/blob/master/apps/files/ajax/upload.php" rel="nofollow">https://github.com/Insiteo/owncloud-core/blob/master/apps/files/ajax/upload.php</a></p>

<p>Not sure if setting directory is mandatory or how to set it.</p>

<p>thanks</p>