Created
May 31, 2016 10:19
-
-
Save gideondsouza/1367104cfc8a83c4b5c924fe467d6032 to your computer and use it in GitHub Desktop.
Uploading multiple files with ruby, uplodify and sinatra : http://www.gideondsouza.com/blog/uploading-multiple-images-with-ruby-and-sinatra/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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