0

Script

<script>
    $(document).ready(function () {
        console.log('@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify.swf")');
        $(function () {
            $("#file").uploadify({
               'uploader': '@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify.swf")',
               'script': '@Url.Action("_UploadImage", "Authors", new { area = "Admin" })',
               'cancelImg': '@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify-cancel.png")',
               'auto': false,
               'multi': false
            });
        })
    });
</script>

Html

@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data", id = "form_image" }))
{
    <p>
        <input type="file" name="file" id="file" />
        <a href="javascript:$('#file').uploadifyUpload();">Resmi Yükle</a>
    </p>
}

consol log output that is the correct as my expected.

localhost:4574/Content/uploadify/uploadify.swf

Error message:

GET localhost:4574/Admin/uploadify.swf?preventswfcaching=1360522154772 404 (Not Found)

Note: script and html codes are in an area that is named "Admin".

I cant find what am I missing. Any advice?

Thanks...

2
  • Show us the generated source.
    – SLaks
    Feb 10, 2013 at 19:04
  • Which part of html do you want to see? a swf object is created, but code is too long and it is difficult to format it. Feb 10, 2013 at 19:12

1 Answer 1

1

BUG When there is no background image uploadify makes a wrong http request to the current page url, appending false at the end.

The solution for this bug lies in "jquery.uplodify.js". Just find this line

  • this.settings.upload_url = WFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url)

And rewrite it as-

  • this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = this.settings.button_image_url ? SWFUpload.completeURL(this.settings.button_image_url) : this.settings.button_image_url

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.