Skip to content

Instantly share code, notes, and snippets.

@gideondsouza
Last active June 15, 2016 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gideondsouza/4284335 to your computer and use it in GitHub Desktop.
Save gideondsouza/4284335 to your computer and use it in GitHub Desktop.
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>::Uploadify Example::</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.uploadify-3.1.min.js")"></script>
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/uploadify.css")" />
<script type="text/javascript">
$(function () {
$('#file_upload').uploadify({
'swf': "@Url.Content("~/Content/uploadify.swf")",
//this is where the file posts when it uploads.
'uploader': "@Url.Action("Upload", "Home")",
'onUploadSuccess' : function(file, data, response) {
//data is whatever you return from the server
//we're sending the URL from the server so we append this as an image to the #uploaded div
$("#uploaded").append("<img src='" + data + "' alt='Uploaded Image' />");
}
});
});
</script>
</head>
<body>
<div>
Click Select files to upload files.
<input type="file" name="file_upload" id="file_upload" />
</div>
<div id="uploaded">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment