Zend Framework + Troubleshoot Flash Loader Issues

I've tried uploading the Uploadify flash loader (www.uploadify.com) to work with Zend Framework, with no success.

I put all Uploadify files in / public / flash -uploader directory.

In the controller, I include all the required files and libraries as follows:

$this->view->headScript()->appendFile('/js/jquery-1.3.2.min.js');
$this->view->headLink()->appendStylesheet('/flash-uploader/css/default.css');
$this->view->headLink()->appendStylesheet('/flash-uploader/css/uploadify.css');
$this->view->headScript()->appendFile('/flash-uploader/scripts/swfobject.js');
$this->view->headScript()->appendFile('/flash-uploader/scripts/jquery.uploadify.v2.1.0.min.js');

      

And then I activate a plugin like this (#photo is the field id of the input file):

$(document).ready(function() {
    $("#photo").uploadify({
    'uploader'       : '/flash-uploader/scripts/uploadify.swf',
    'script'         : 'my-account/flash-upload',
    'cancelImg'      : '/flash-uploader/cancel.png',
    'folder'         : 'uploads/tmp',
    'queueID'        : 'fileQueue',
    'auto'           : true,
    'multi'          : true,
        'sizeLimit'      : 2097152
    });
});

      

As you can see, I am targeting the upload of my-account / flash-upload script as backend processing (my account is the controller, flash-upload is the action).

My form markup looks like this:

<form enctype="multipart/form-data" method="post" action="/my-account/upload-public-photo"><ol>
<li><label for="photo" class="optional">File Queue<div id="fileQueue"></div></label>
<input type="hidden" name="MAX_FILE_SIZE" value="31457280" id="MAX_FILE_SIZE" />
<input type="file" name="photo" id="photo" class="input-file" /></li>
<li><div class="button">
<input type="submit" name="upload_public_photo" id="upload_public_photo" value="Save" class="input-submit" /></div></li></ol></form>

      

And yet it doesn't work. The view button is also not displayed as in the demo page, I only get the regular input file field.

Any ideas where the problem might be? I've been looking at the code for hours now and I don't see any error anywhere and I start to exhaust myself after going through 30 lines of code 30 times in a row.

+2


source to share


1 answer


Looking through the demo code and documentation: it seems that the plugin provides "FORM" elements by itself.

You should try to put your input field outside the form



Never used this tool before, just my 2 cents :)

+1


source







All Articles