This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » sfWidgetFormInputSWFUploadPlugin problem
sfWidgetFormInputSWFUploadPlugin problem [message #87660] Sat, 31 October 2009 12:22 Go to next message
danr  is currently offline danr
Messages: 175
Registered: February 2008
Senior Member
Hello.

I am using Symfony 1.2 and have the Flash 10 player. However, When using this plugin I get an exception showing in Firebug when the page is rendered:

uncaught exception: Could not find the placeholder element: incident_files_swfupload_target

The SWFUploader still shows on the page but when I click the 'Browse Files' button nothing happens. I have read about various issues when using Flash 10 due to some security features implemented but these have been overcome by the SWFUpload team in version 2.2 upwards, which I believe this plgin uses.

Having looked at the page source I notice that the incident_files_swfupload_target that is being complained about in the Firebug error does actually exist:

<input type="file" name="incident[files]" id="incident_files" />      <div class="swfupload-buttontarget" id="incident_files_swfupload_target">
        <noscript>
          We're sorry.  SWFUpload could not load.  You must have JavaScript enabled to enjoy SWFUpload.
        </noscript>
      </div>

      <script type="text/javascript">
        //<![CDATA[
        SWFUpload.onload = function()
        {
          var swfu = new SWFUpload
          ({
            upload_url : "/portal_dev.php/incident/edit/id/183",
            flash_url : "/sfWidgetFormInputSWFUploadPlugin/js/vendor/swfupload/Flash/swfupload.swf",
            button_placeholder_id : "incident_files_swfupload_target",


I have tried placing the code:

  <?php echo $form->renderHiddenFields() ?>
  <?php foreach($form->getJavascripts() AS $javascript):?>
    <?php use_javascript($javascript)?>
  <?php endforeach?>
  <?php foreach($form->getStylesheets() AS $link => $media):?>
  <?php use_stylesheet($link)?>
  <?php endforeach?>


inside the form, at the end of the partial and at the end of the template but this issue still occurs.

Does anyone know why I am experiencing this problem please?

Thank you.

[Updated on: Sat, 31 October 2009 12:24]

Re: sfWidgetFormInputSWFUploadPlugin problem [message #87725 is a reply to message #87660 ] Mon, 02 November 2009 22:11 Go to previous messageGo to next message
danr  is currently offline danr
Messages: 175
Registered: February 2008
Senior Member
I removed this code:

  <?php echo $form->renderHiddenFields() ?>
  <?php foreach($form->getJavascripts() AS $javascript):?>
    <?php use_javascript($javascript)?>
  <?php endforeach?>
  <?php foreach($form->getStylesheets() AS $link => $media):?>
  <?php use_stylesheet($link)?>
  <?php endforeach?>


because of course this caused the javascript and css to be added in twice (in the <head> and the <body>).

This resolved the javascript error mentioned earlier in the post but when I click 'Browse Files' the file dialog still does not appear.

Does anyone have any suggestions as to what is wrong?

Thank you.
Re: sfWidgetFormInputSWFUploadPlugin problem [message #88000 is a reply to message #87725 ] Sun, 08 November 2009 14:17 Go to previous messageGo to next message
pulsar  is currently offline pulsar
Messages: 3
Registered: March 2007
Junior Member
Hey,

I've been struggling with the same problem today. Until I noticed, that the Flash <object> has been placed in the top left corner of the document, invisible. And, incidentally, has the same dimensions as the "Browse" <div>.

So the positioning was messed up (the flash is positioned with position: absolute), and the simple fix is to wrap the whole widget in a div with position: relative;

Hope that helps!

Lars
Re: sfWidgetFormInputSWFUploadPlugin problem [message #88028 is a reply to message #88000 ] Mon, 09 November 2009 11:00 Go to previous messageGo to next message
danr  is currently offline danr
Messages: 175
Registered: February 2008
Senior Member
Yes, in the end I found the badly-positioned button by setting the swfupload_button_image_url option like this:

$this->widgetSchema['file'] = new sfWidgetFormInputSWFUpload(array('swfupload_button_image_url' => public_path('/images/add.png'), 'swfupload_upload_url' => url_for('filehandler/upload').'?action=upload&'.ini_get('session.name').'='.session_id()));


which displayed the button image.

Your information about correcting the positioning is very useful though.

I have still not been able to get it working fully as now I get an 'HTTP Authorization error' when clicking the upload button. I think it is something to do with the session not been carried across to my Symfony action (I read some posts elsewhere on this forum). If you've managed to get it working I'd really appreciate being able to see your code, including action code as I'd like to use this control.

Thanks.

[Updated on: Mon, 09 November 2009 11:09]

icon3.gif  Re: sfWidgetFormInputSWFUploadPlugin problem [message #103289 is a reply to message #88028 ] Fri, 30 July 2010 12:33 Go to previous message
SmallBen  is currently offline SmallBen
Messages: 21
Registered: September 2009
Junior Member
I've got the same problem, have you found solution?
Previous Topic:ckWebServicePlungin Recive byte[] parameter
Next Topic:sfWidgetFormInputSWFUpload doesn't work
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software