With the below description you can upload assets to your Razuna installation remotely.
Uploading assets remotely
Uploading assets within your application has to actually happen with posting the asset to the Razuna web service. The http protocol allows a multipart/form-data POST (RFC 1867) to upload files. You have to pass the required parameters in the form data. These must precede any multipart form data which contains file content. This allows us to verify security before attempting to accept the upload, if this is not done you will receive an error.
The maximum content size is limited to the maximum content-length of a HTTP request. If you exceed the maximum value you get a 10001 error.
required parameter is "c.apiupload"
A valid api_key
The folder you want to store the asset in
The name of the file field (filedata)
This field has to be named "filedata" !
To extract a ZIP archive after uploading or not
0 = false
If you turn debug on you will receive an email with the values you are passing to the API
0 = false (default)
Enter your eMail address in order to receive the debug email
A full URL where to redirect the output of the upload
You will get a response with "responsecode=(0)&message=(status message)&assetid=(asset id)"
Razuna 1.4.4 adds the assetid return parameter
Additional parameters you would like to pass to the "redirectto" string above
Set this to 1 to add metadata during upload. Please note important information below!
0 = false (default)
Set the language you want to write the metadata for. Mandatory if you want to write metadata!
1 = English
|upl_template||ID of the upload template to execute||String||no||54592180064BC7466F4B2F943||Razuna 1.6|
|skip_event||The event name you want to skip (only in combination with the workflow plugin)||String||no|
on_pre_process = Pre-Process
You can skip many events by separating each event with a comma, e.g. "on_pre_process,on_file_add"
How to add metadata to your asset during upload
As of Razuna 1.4.5 you can populate the metadata fields during the upload. For this to work you need to add the field "metadata" to your post with the value "1". Furthermore, you need to prefix each metadata field with "meta_". A list of the correct and available metadata fields is available here.
Example: Populate the description, keywords and the location metadata:
meta_img_description = "My description"
meta_img_keywords = "razuna, image, eyes"
meta_location = "New York"
meta_lang_id_r = 1
You DO NOT need to pass a JSON structure. Razuna reads your form fields automatically!
The below will be returned to you in XML format.
A result code with the status of the login. If the result is 0 the method was successful.
The ID of the asset in Razuna
The file type (img = image, vid = video, aud = audio, doc = document, other = other format
|comingfrom||The HTTP referrer of the request||http://myuploadscript||Version 1.6|
|renamefilebody||Requests coming back when using the workflow pre-process rename action||Version 1.6 in combination of the Workflow plugin|
Sample HTTP Form
Sample CURL command
Demo Upload Templates
We have made two examples of uploading assets to Razuna within the API2/demo folder. One example is a simple form post and the other a integration with the popular SWFUpload uploader. You will need to run these two examples from within Razuna in order to work, since they work with Razuna only.
Flash or Flex
If you are using a Flash, Flex or AIR application to upload assets to Razuna you will need to use the URL with parameters since Flash only send the filedata id in the post. So you would use the URL of the form action like: http://demo.razuna.com/index.cfm?fa=c.apiupload&sessiontoken=54592180-7060-4D4B-BC74-2566F4B2F943&destfolderid=1&zip_extract=1