The createFile() method adds a file to your Library. If the new file will overwrite an existing file, the “force”
argument must be provided in order to prevent a fault from being thrown.
The “file” argument must be a FileSpec with a “filename” specified and either its “contents” or “location” specified. If the
“contents” are specified, they should be Base64-encoded. Alternately the URL of the file to upload can be given in the
“location” part of the FileSpec.
argument must be provided in order to prevent a fault from being thrown.
The “file” argument must be a FileSpec with a “filename” specified and either its “contents” or “location” specified. If the
“contents” are specified, they should be Base64-encoded. Alternately the URL of the file to upload can be given in the
“location” part of the FileSpec.
Input
session_id [xsd:string] (required)
Your API session id.
file [vrtypens:FileSpec] (required)
A FileSpec describing the file to create.
force [xsd:boolean]
Whether to prevent a fault from being thrown when the new file would overwrite an existing file
Output
[xsd:boolean]
Examples
Perl
$vrapi->createFile( {
session_id => $sid,
file => {
media_library_directory => '/',
filename => 'vr_logo.gif',
location => 'https://img.verticalresponse.com/images/cobrand/vr/logo.gif',
},
} );
PHP
$vrapi->createFile( array(
'session_id' => $sid,
'file' => array(
'media_library_directory' => '/',
'filename' => 'vr_logo.gif',
'location' => 'https://img.verticalresponse.com/images/cobrand/vr/logo.gif',
),
) );
