How to display websites in iframe

回眸只為那壹抹淺笑 提交于 2019-12-11 08:18:18

问题


I am using ruby and sinatra. I need to create a website that allows the user to upload a zipfile of other websites and display all of them in multiple iframes on the page but I'm not sure how to even start this.

so far I have made the website that can upload a zipfile and have placed it in an uploads folder and i can display that on website by doing

<iframe src="../uploads/test.html" width="100%" height="600">
    <p>Your browser does not support iframes.</p>
</iframe>

post '/upload' do
File.open('uploads/' + params['file'][:filename], 'w') do |f|
  f.write(params['file'][:tempfile].read)
end
end

the thing is i wont necessarily know the names of the html files or how many there are to just place the name of it

来源:https://stackoverflow.com/questions/47612817/how-to-display-websites-in-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!