]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojo/tests/io/iframeUploadTest.html
Comment class stub
[eow] / static / dojo-release-1.1.1 / dojo / tests / io / iframeUploadTest.html
1 <html>
2         <head>
3                 <style type="text/css">
4                         @import "../../resources/dojo.css";
5                 </style>
6                 <script type="text/javascript"
7                         djConfig="isDebug: true, dojoIframeHistoryUrl: '../../resource/blank.html'"
8                         src="../../dojo.js"></script>
9
10                 <script type="text/javascript">
11                         dojo.require("dojo.io.iframe");
12
13                         var callCount = 0;
14                         var ioResponse;
15
16                         function sendIt(){
17                                 dojo.io.iframe.send({
18                                         form: dojo.byId("uploadForm"),
19                                         handleAs: "application/json",
20                                         content: {
21                                                 increment: callCount++,
22                                                 fileFields: "ul1"
23                                         },
24                                         handle: function(response, ioArgs){
25                                                 if(response instanceof Error){
26                                                         console.debug("Request FAILED: ", response);
27                                                 }else{
28                                                         console.debug("Request complete: ", response);
29                                                 }
30                                                 ioResponse = response; // to get at afterwards in debugger.
31                                         }
32                                 });
33                         }
34                 </script>
35         </head>
36         <body>
37                 <p>This file tests dojo.io.iframe upload using a form POST with a file upload button.</p>
38
39                 <p>
40                 <b>Note:</b> This test makes a form POST to upload.cgi. This cgi needs to be made executable for this test to work, and it won't work from local disk.
41                 </p>
42                 <form action="upload.cgi" id="uploadForm" 
43                         method="POST"  enctype="multipart/form-data">
44                         <input type="text" name="foo" value="bar">
45                         <input type="file" name="ul1">
46                         <input type="button" onclick="sendIt(); return false;" value="send it!">
47                 </form>
48         </body>
49 </html>
50