Question

I am using JQuery/Uploadify plug-in to upload multiple files. This works fine if the .aspx page is in the root folder, but not if it is in a subfolder.

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="UploadifyTestMasterPage1.SiteMaster" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>        
    <script type="text/javascript" src="../scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery.uploadify.js"></script>        
</head>

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="UploadifyTest1.aspx.cs" Inherits="UploadifyTestMasterPage1.Jobs.UploadifyTest1" %>
    <script type="text/javascript">
        $(window).load(
    function () {
        $("#<%=FileUpload1.ClientID%>").fileUpload({
            'uploader': 'scripts/uploader.swf',
            'cancelImg': 'images/cancel.png',
            'buttonText': 'Browse Files',
            'script': 'Upload.ashx',
            'folder': 'uploads',
            'fileDesc': 'Image Files',
            'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
            'multi': true,
            'auto': false
        });
    }
);
    </script>

I have tried using ResolveUrl in the MasterPage, but it didn't seem to work; though my syntax may have been wrong.

In IE, as the code stands, the Flash upload button does not appear, and right-clicking where it should be reveals the message: "movie not loaded".

Any help would be appreciated. Thanks.

Was it helpful?

Solution

You are loading scripts/uploader.swf from the folder you are in, if you want to resolve that url from the root of your site then put a trailing / at the path /scripts/uploader.swf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top