Sorry... I can't deal with all the SPAM so until I can find a better solution for the forums, I'm locking them down. For now please use awesome services like stackoverflow.com for community support. Thanks.
This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
making uploadify work under web2py
  • Hi,

    I am trying to use uploadify to upload files to my web2py application. The files content is stored in a database, not in the file system. I was able to use a similar product, swfupload, but I am attracted by uploadify configurability and elegance. I am working in a Ubuntu 9.4 virtual machine (VirtualBox). The server, while I develop, is web2py's local server. FireFox 3.5 is the browser I use.

    I am using the latest uploadify (2.10).

    The main problem is that I can't have my files get uploaded. A smaller issue is that the fileExt option is ignored.

    When I enable the checkScript option, my server side handler is reached and using my debugger I can see the expected list of key-file pairs. However, nothing happens after that. If I do not enable checkScript and set auto to true, I receive an HTTP 400 exception. the 'script' handler is never reached. Whatever I do, I do not have the "Upload | Clear Queue" line beneath the file list. Removing one file from the list works OK.


    My html file is a web2py template, so I attach below the source of the page (^U).

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
    <!--
    Design by Free CSS Templates
    <!-- m --><a class="postlink" href="http://www.freecsstemplates.org">http://www.freecsstemplates.org</a><!-- m -->
    Released for free under a Creative Commons Attribution 2.5 License

    <html xmlns="http://www.w3.org/1999/xhtml"&gt;
    <head>
    <title>None+None</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link href="/lab/static/style.css"
    rel="stylesheet" type="text/css" charset="utf-8" />

    <link href="/lab/static/slide_menu/jqueryslidemenu.css"
    rel="stylesheet" type="text/css" charset="utf-8" />
    <b><script src="/lab/static/js/jquery.js"></script>
    </b><link charset="utf-8" href="/lab/static/calendar.css" rel="stylesheet" type="text/css" />
    <script src="/lab/static/js/calendar.js"></script>

    <link href="/lab/static/js/style.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
    <!--link href="/lab/static/js/calendar.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
    <script src="/lab/static/js/jquery.js" type="text/javascript"></script>
    <script src="/lab/static/js/calendar.js" type="text/javascript" charset="utf-8"></script-->
    <div id="page">
    <div id="content">

    <script src="/lab/static/js/uploadify/swfobject.js" type="text/javascript"></script>
    <script src="/lab/static/js/uploadify/jquery.uploadify.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/lab/static/js/uploadify/uploadify.css" TYPE="text/css" MEDIA="screen">
    <div id='uploader'>

    <p>
    Select as many files as you like using ctrl and shift click.<br />
    When done, press the "open" button.
    </p>

    <input type="file" id="uploaderID" name="uploaderID" />
    </div>

    <b><script type="text/javascript">
    $(document).ready(function() {
    $('#uploaderID').uploadify({
    'uploader': "/lab/static/js/uploadify/uploadify.swf",
    'expressInstall': "/lab/static/js/uploadify/expressInstall.swf",
    'script': "/lab/work_space/handle_uploadify",
    'checkScript': "/lab/work_space/check_uploadify",
    'folder': 'uploaded_files',
    'multi': true,
    'cancelImg': "/lab/static/js/uploadify/cancel.png",
    'height' : '33',
    'fileExt': '*.txt;*.html;*.docx',
    'onComplete' : function(a, b, c, d, e) {
    alert(d)},
    'buttonText': 'Select files',
    'auto': false,
    'scriptAccess': 'always',
    onError: function (a, b, c, d) {
    if (d.status == 404)
    alert('Could not find upload script. Use a path relative to: '+' /home/haim/web2py');
    else if (d.type === "HTTP")
    alert('Error:' + d.type+ ' Info: '+d.info + ' a: ' + a + ' b: ' + b + ' c: ' + c);
    else if (d.type ==="File Size")
    alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
    else
    alert('error '+d.type+": "+d.text);
    },
    });
    });
    </script>
    </b>
    </div>

    <div style="clear: both;">&amp;nbsp;</div>
    </div>
    <div id="footer">
    <p>copyright SenseForge Ltd (C) - Powered by <a href="http://www.web2py.com">web2py</a></p&gt;
    <p>


    Revision: 649
    Last Change Date: 2009-10-07 17:25:11 -0400 (Wed, 07 Oct 2009)
    </p>
    </div>

    </body>
    </html>
  • Just something I found about the error: the server complains that the line "User-Agent: Shockwave Flash" does not end with CRLF.
  • Hello,

    Was your problem solved? I have the same problem here? what should I do to solve it?

    Thank you,
    Abeer