# vim: sw=3 ts=3 ft=org
#+TITLE: RESTful Upload Element
#+STYLE: <LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />
#+AUTHOR: Steffen Panning
#+OPTIONS:   H:2 num:1 toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+EMAIL: 
#+TEXT: [[file:../index.org][Getting Started]] | [[file:../api.org][API]] | [[file:../elements.org][*Elements*]] | [[file:../actions.org][Actions]] | [[file:../validators.org][Validators]] | [[file:../handlers.org][Handlers]] | [[file:../config.org][Configuration Options]] | [[file:../about.org][About]]

* RESTful Upload Element - #restful\_upload {}
  The button element produces an HTML input element that has type
  attribute 'file'. The input element represents a file-choose dialog.
  When the restful\_submit element is clicked, the chosen file will be
  uploaded to the server.
  To fetch the content of the uploaded file, You first have to get the
  request-bridge by calling 'wf\_context:request\_bridge()'; after
  that you have to query for the uploaded file by searching
  the elements returnd by 'post\_files()'.

** Usage

#+BEGIN_SRC erlang
   #restful_upload { id = upload, text="Go!" },
   %% later on return 
   Req = wf_context:request_bridge(),
   UploadedFiles = Req:post_files(),
   %% ...
#+END_SRC

** Attributes

   + text - (/string/) :: The button's title.

   + html\_encode - (/boolean/) :: Set to true to safely html-encode the text.

   + html\_name - (/string/) :: The name attribute of the restful\_upload 

** See Also

   + [[./base.html][Base]]

   + [[./link.html][Link]]

   + [[./textbox.html][Textbox]]

   + [[./password.html][Password]]

   + [[./textarea.html][Textarea]]

   + [[./checkbox.html][Checkbox]]

   + [[./dropdown.html][Dropdown]]

   + [[./option.html][Dropdown Option]]

   + [[./restful_form.org][RESTful Form]]

   + [[./restful_reset.org][RESTful Reset]]

   + [[./restful_upload.org][RESTful Upload]]
    
