This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Vuzit_Document_upload
Vuzit_Document upload function
Uploads a document to the Vuzit web service.
Signatures
- public static Document upload($path, $options = null)
Parameters
- string $path : Path to a file on the file system.
- array $options : Options for the uploaded file. See “Options” below.
Options
Options for the array.
- download_document – bool : Specifies if the original document (such as a DOC, XLS, PDF, PPT file) is downloadable via the viewer control bar. The value is either “true” or “false”.
- download_pdf – bool : Specifies if the generated PDF file, if the originating document was not a PDF, is downloadable via the viewer control bar. The value is either “true” or “false”.
- secure – bool : Specifies whether the document should be public or private. The value is either “true” or “false”.
- file_type – string : The short extension of the file type of the document to be uploaded (e.g. pdf, doc, ppt, etc.) This parameter is required if the file does not have an extension in the filename, and specifying this parameter overrides any existing extension that appears in the filename.
Return type
- Document : The new document with an ID. None of the other properties will be available. You’ll need to use the findById method to load them.
Usage Examples
Simple upload example.
Vuzit_Service::setPublicKey('YOUR_PUBLIC_API_KEY');
Vuzit_Service::setPrivateKey('YOUR_PRIVATE_API_KEY');
$doc = Vuzit_Document::upload("c:/path/to/document.pdf");
echo "Document id: " . $doc->getId();
Example that sets the “secure” and “file_type” options for the document.
Vuzit_Service::setPublicKey('YOUR_PUBLIC_API_KEY');
Vuzit_Service::setPrivateKey('YOUR_PRIVATE_API_KEY');
$doc = Vuzit_Document::upload("c:/path/to/document.pdf", array("secure" => true,
"file_type" => "pdf"));
echo "Document id: " . $doc->getId();






