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.  

Hi Jason,

The dndupload_ajax_processor class in the github url in my original post (i can not enter a correct link yet)  shows how to create a resource. I can create an empty resource from this code.

I have been working further at this problem. I still can not associate the uploaded file with the resource though. The drag and drop code saves the file to a draft area before creating the resource. The file attribute of the $data object is set to the draftitemid, gained from file_get_unused_draft_itemid().

My file is in the private user file and setting the $data->file attribute to the itemid has no effect. 

I suppose, my question now is, what is the correct way to associate the file to the resource, or, how do I move the file to the draft area that the draftitemid points to?

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>