Guest User

Untitled

a guest
Aug 22nd, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. require "cgi"
  4. require "erb"
  5.  
  6. cgi = CGI.new
  7. fObj = cgi.params["upfile"][0]
  8.  
  9. hlfile = File.new("hypergraph.hl", "w")
  10. hlfile.puts(fObj.read)
  11. hlfile.close
  12.  
  13. @a = %x{hypergraph -ol hypergraph.hl}
  14. tmpl = File.read("../uploaded.html")
  15.  
  16. out = ERB.new(tmpl)
  17.  
  18. print "Content-type: text/html\n\n"
  19. print out.result()
Advertisement
Add Comment
Please, Sign In to add comment