examples/tiny/public/upload.xhtml in nitro-0.13.0 vs examples/tiny/public/upload.xhtml in nitro-0.14.0
- old
+ new
@@ -1,23 +1,21 @@
<?xml version="1.0"?>
<html>
-<?r
- file = context['file']
+ <?r
+ file = context['file'].read
+ File.open('public/image.png', 'wb') do |f|
+ f << file
+ end
+ ?>
- File.open('koko.png', 'wb') do |f|
- f << file
- end
-?>
- <h1>#{context['title']}</h1>
+ <h1>#{request['title']}</h1>
- <img src="" />
+ <p><img src="image.png" /></p>
- --- #{context['file'].class}<br />
-
- #{context.params.keys}
- <br />
-
- #{context.params.values.collect {|v| v.class}.join('<br />')}
+ <p>
+ <strong>original:</strong> #{request['file'].original_filename}<br />
+ <strong>content type:</strong>#{request['file'].content_type}<br />
+ </p>
</html>