Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uploading multiple files with ruby, uplodify and sinatra : http://www.gideondsouza.com/blog/uploading-multiple-images-with-ruby-and-sinatra/
<html>
<head>
<title>Image Upload</title>
<link rel="stylesheet" type="text/css" href="uploadify.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.uploadify.min.js"></script>
</head>
<body>
<h1>Upload Images</h1>
<input type="file" name="file_upload" id="file_upload" />
<script>
$(function() {
$('#file_upload').uploadify({
'swf' : 'uploadify.swf',
'uploader' : '/upload',
'onUploadSuccess' : function(file, data, response) {
$("#images").append("<img src='/" + data + "' height='100px'/>");
}
});
});
</script>
<div id="images">
<strong>Uploaded images here:</strong><br />
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment