[help]how to use the webservice api:core_files_upload

[help]how to use the webservice api:core_files_upload

by json king -
Number of replies: 1

Hi,i want to use the api:core_files_upload.but when i use it,moodle throw a execption as follow; 

<EXCEPTION class="moodle_exception">
<ERRORCODE>nofile</ERRORCODE>

I use a from to send the request ad fellow:
<form action="../webservice/rest/server.php" method="get">
<input type="hidden" name="wstoken" value="1825cdb79d6197f84f0fea45163ca7ca">
<input type="hidden" name="wsfunction" value="core_files_upload">
<input type="hidden" name="contextid" value="2">
<input type="hidden" name="component" value="user">
<input type="hidden" name="filearea" value="private">
<input type="hidden" name="itemid" value="0">
<input type="hidden" name="filepath" value="/">
<input type="hidden" name="filename" value="test.jpg">
<input type="hidden" name="filecontent" value="base64_encode">
<input type="hidden" name="contextlevel" value="user">
<input type="submit" value="Submit" >
</form>
the test.jpg's path is the same as the html file.If the filepath is false,can you tell me what can I change it to make it work?
 I'm looking forward to your reply!

Average of ratings: -