0

I have a link:

https://s3.amazonaws.com/screensteps_live/step_images/adabys/manuals/2292/New_section____ddown.pdf?AWSAccessKeyId=dsDSAw&Expires=2231231&Signature=AFNkandsakdIWwdwda%3D

Can I get the size of this PDF without downloading it or this is impossible?

Ray
  • 1

1 Answers1

0
require "net/https"
require "uri"

uri = URI('https://example.com')

Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https'){|http|
  response = http.head('/')
  puts response.content_length
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ryan Porter
  • 1,982
  • 1
  • 11
  • 17
  • LOL. There were explict instructions on the form when I answered that said to be kind and welcoming to the first-time poster. Perhaps there is an official policy document somewhere with specific approved phrases for doing that? – Ryan Porter May 28 '21 at 18:03
  • Generally, we discourage formalities like “hello”, “thanks”, &c. since they are conversational and take away from the focus of posts. That said different reviewers are more sensitive to it than others. I tend to only remove them when correcting more serious grammar or formatting issues—though I do remove them in that case, as a matter of housekeeping. – Jeremy Caney May 29 '21 at 03:41
  • As far as being kind and welcoming, the main concern is being patient as they learn the ropes, and being constructive in criticism. Often, newcomers don’t understand the format and make basic mistakes that can solicit quick kicks from experienced members, and are off-putting to fledgling contributors. Still, like you, I’ll often include a “welcome” note as an acknowledgment, and especially in comments ‍♂️ – Jeremy Caney May 29 '21 at 03:45
  • describe Me do describe "when helping people" do it "should include code" do { expect(subject).to include_content_type(:code) } end describe "on Stack Overflow" do it "should include no conversation" do { expect(subject).to not include_content_type(:conversation) } end end end ... Finished in 0.00216 seconds (files took 1.18 seconds to load) 1 example, 0 failures, 0 pending – Ryan Porter May 29 '21 at 18:52