class_docstr: File from URL wrapper.
  
  The :class:`FileFromURLWrapper` object gives you the ability to stream file
  from provided URL in chunks by :class:`MultipartEncoder`.
  Provide a stateless solution for streaming file from one server to another.
  You can use the :class:`FileFromURLWrapper` without a session or with
  a session as demonstated by the examples below:
  
  .. code-block:: py
  
      # no session
  
      import requests
      from requests_toolbelt import MultipartEncoder, FileFromURLWrapper
  
      url = 'https://httpbin.org/image/png'
      streaming_encoder = MultipartEncoder(
          fields={
              'file': FileFromURLWrapper(url)
          }
      )
      r = requests.post(
          'https://httpbin.org/post', data=streaming_encoder,
          headers={'Content-Type': streaming_encoder.content_type}
      )
  
  .. code-block:: py
  
      # using a session
  
      import requests
      from requests_toolbelt import MultipartEncoder, FileFromURLWrapper
  
      session = requests.Session()
      url = 'https://httpbin.org/image/png'
      streaming_encoder = MultipartEncoder(
          fields={
              'file': FileFromURLWrapper(url, session=session)
          }
      )
      r = session.post(
          'https://httpbin.org/post', data=streaming_encoder,
          headers={'Content-Type': streaming_encoder.content_type}
      )
class_docstr_tok: ["File","from","URL","wrapper",".","The",":","class",":","`","FileFromURLWrapper","`","object","gives","you","the","ability","to","stream","file","from","provided","URL","in","chunks","by",":","class",":","`","MultipartEncoder","`",".","Provide","a","stateless","solution","for","streaming","file","from","one","server","to","another",".","You","can","use","the",":","class",":","`","FileFromURLWrapper","`","without","a","session","or","with","a","session","as","demonstated","by","the","examples","below",":","..","code-block",":",":","py","#","no","session","import","requests","from","requests_toolbelt","import","MultipartEncoder",",","FileFromURLWrapper","url","=","'https",":","\/\/httpbin.org\/image\/png'","streaming_encoder","=","MultipartEncoder","(","fields=","{","'file","'",":","FileFromURLWrapper","(","url",")","}",")","r","=","requests.post","(","'https",":","\/\/httpbin.org\/post","'",",","data=streaming_encoder",",","headers=","{","'Content-Type","'",":","streaming_encoder.content_type","}",")","..","code-block",":",":","py","#","using","a","session","import","requests","from","requests_toolbelt","import","MultipartEncoder",",","FileFromURLWrapper","session","=","requests.Session","(",")","url","=","'https",":","\/\/httpbin.org\/image\/png'","streaming_encoder","=","MultipartEncoder","(","fields=","{","'file","'",":","FileFromURLWrapper","(","url",",","session=session",")","}",")","r","=","session.post","(","'https",":","\/\/httpbin.org\/post","'",",","data=streaming_encoder",",","headers=","{","'Content-Type","'",":","streaming_encoder.content_type","}",")"]
code: def __init__(self, file_url, session=None):
      self.session = session or requests.Session()
      requested_file = self._request_for_file(file_url)
      self.len = int(requested_file.headers["content-length"])
      self.raw_data = requested_file.raw
  
imports: import contextlib
  import io
  import os
  from uuid import uuid4
  import requests
  from .._compat import fields
label_desc: Use image node_id 1 to create a new FileFromURLWrapper object from inherited base classes: object with example: obj = FileFromURLWrapper(file_url, session)