genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
586 stars 263 forks source link

Failed to load resource (swf) #85

Open DeluxZ opened 12 years ago

DeluxZ commented 12 years ago

I'm trying to use you bundle in my project to upload an image to the server.

# config.yml
genemu_form:
    file:
        enabled:  true
        uploader: /static/uploadify/uploadify.swf
# routing.yml
genemu_upload:
    resource: "@GenemuFormBundle/Controller/UploadController.php"
    type:     annotation
// FormType.php
public function buildForm(FormBuilder $builder, array $options)
{
    $builder->add('image', 'genemu_jqueryfile');
}
{# in my form file #}
<link rel="stylesheet" type="text/css" href="{{ asset('/static/uploadify/uploadify.css') }}" />
{{ form_stylesheet(form) }}

<script src="{{ asset('/static/uploadify/jquery.uploadify.js') }}" type="text/javascript"></script>
{{ form_javascript(form) }}

When I load the page it shows the SELECT FILES button, but the SWF isn't loaded. When I check my developer console I see the following error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error). The resource is the uploadify.swf, but it's trying to load it from app_dev.php/route/uploadify.swf instead of app_dev.php/static/uploadify/uploadify.swf

DeluxZ commented 12 years ago

I think it's because I'm using Uploadify 3.0.1. Changed

https://github.com/genemu/GenemuFormBundle/blob/master/Resources/views/Form/jquery_layout.html.twig#L522 to https://github.com/DeluxZ/GenemuFormBundle/blob/master/Resources/views/Form/jquery_layout.html.twig#L522

Then the swf is loaded correctly, but the uploading is failing

inoryy commented 12 years ago

Hello, did you find a solution to this issue?