<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h1&gt;Vuzit::Document.upload function&lt;/h1&gt;
&lt;p&gt;Uploads a document to the Vuzit web service.&lt;/p&gt;
&lt;h2&gt;Signatures&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;static&lt;/em&gt; [[Vuzit_Document|Document]] upload(path, options = nil)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Parameters&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;string&lt;/em&gt; &lt;strong&gt;path&lt;/strong&gt; : Path to a file on the file system.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.ruby-doc.org/core/classes/Hash.html&quot;&gt;Hash&lt;/a&gt; &lt;strong&gt;options&lt;/strong&gt; : Options for the uploaded file. See &#8220;Options&#8221; below.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Options&lt;/h3&gt;
&lt;p&gt;Options for the Hash.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;download_document&lt;/strong&gt; &amp;#8211; bool : Specifies if the original document (such as a &lt;span class=&quot;caps&quot;&gt;DOC&lt;/span&gt;, &lt;span class=&quot;caps&quot;&gt;XLS&lt;/span&gt;, &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt;, &lt;span class=&quot;caps&quot;&gt;PPT&lt;/span&gt; file) is downloadable via the viewer control bar.  The value is either &amp;#8220;true&amp;#8221; or &amp;#8220;false&amp;#8221;.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;download_pdf&lt;/strong&gt; &amp;#8211; bool : Specifies if the generated &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; file, if the originating document was not a &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt;, is downloadable via the viewer control bar.  The value is either &amp;#8220;true&amp;#8221; or &amp;#8220;false&amp;#8221;.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;secure&lt;/strong&gt; &amp;#8211; bool : Specifies whether the document should be public or private.  The value is either &amp;#8220;true&amp;#8221; or &amp;#8220;false&amp;#8221;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Return type&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;[[Vuzit_Document|Document]] : The new document with an ID.  None of the other properties will be available.  You&amp;#8217;ll need to use the find_by_id method to load them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Usage Examples&lt;/h2&gt;
&lt;p&gt;Simple upload example.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Vuzit::Service.public_key = &quot;YOUR_PUBLIC_API_KEY&quot;
Vuzit::Service.private_key = &quot;YOUR_PRIVATE_API_KEY&quot;

doc = Vuzit::Document.upload('c:\path\to\document.pdf')  

puts &quot;Document id: &quot; + doc.Id
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example that sets the &amp;#8220;secure&amp;#8221; and &amp;#8220;file_type&amp;#8221; options for the document.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Vuzit::Service.public_key = &quot;YOUR_PUBLIC_API_KEY&quot;
Vuzit::Service.private_key = &quot;YOUR_PRIVATE_API_KEY&quot; 

doc = Vuzit::Document.upload(&quot;c:/path/to/document.pdf&quot;, :secure =&amp;gt; true, 
                                                        :file_type =&amp;gt; &quot;pdf&quot;))

puts &quot;Document id: &quot; + doc.id
&lt;/code&gt;
&lt;/pre&gt;</body>
  <created-at type="datetime">2009-11-24T03:56:35-08:00</created-at>
  <id type="integer">315479</id>
  <permalink>vuzit_document_upload</permalink>
  <repository-id type="integer">164824</repository-id>
  <title>Vuzit_Document_upload</title>
  <updated-at type="datetime">2009-11-02T08:13:25-08:00</updated-at>
  <user-id type="integer">62149</user-id>
</wiki>
