Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

Re: Add a resource using a custom web service

$
0
0
by John Roche.  

As I have said, I have the web service running and creating a empty resource. I am having difficulty associating the file in the user private area to the resource.

I know where the drag and drop implementation links the resource to the file;

$resource = new stdClass();
$resource->course = $this->course->id;
$resource->name = $displayname;
$resource->intro = '"';
$resource->description = ''";
$resource->introformat = FORMAT_HTML;
$resource->coursemodule = $this->cm->id;
$resource->type = $this->type;

$resource->files = $draftitemid; // This attribute is pointing to a draft area that contains the file

and then the resource is added

$instanceid = resource_add_instance($resource, null);

I can not get past this point and I would appreciate some help.

What should I assign to $resource->files be so that the resource will contain the file that is in the user private file?

John


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>