Hello all,
When I use uploadify to upload photos to the server I use the following script (The script is placed in the Photo.aspx (this is the view of the UploadController and the Photo action)):
<script type="text/javascript">
$(document).ready(function () {
$("#fileInput").uploadify({
uploader: "../../Images/uploadify.swf",
script: "../../Upload/Upload.ashx",
cancelImg: "../../Images/cancel.png",
auto: true,
multi: true,
folder: "Folder/Photos",
onError: function (a, b, c, d) {
if (d.status == 404)
alert("Could not find upload script. Use a path relative to: bla ");
else if (d.type === "HTTP")
alert("error " + d.type + ": " + d.info);
else if (d.type === "File Size")
alert(c.name + " " + d.type + " Limit: " + Math.round(d.sizeLimit / 1024) + "KB");
else
alert("error " + d.type + ": " + d.text);
}
});
});
</script>
Found here
Everything works fine until I've selected the files and the script starts uploading. Error HTTP: 404. This means, it doesn't find the script file. I tried everything: script: "../../Upload.ashx", script: "../Upload.ashx", script: "Upload.ashx", etc..
The Upload.ashx is placed in Views/Upload/Upload.ashx (This folder also contains the Photo.aspx from the UploadController which contains the uploadify script). The scripts are loaded at the end of my page. I don't understand why uploadify can't find the script when I use the 'script: "Upload.ashx"' property. Can someone help with this?