def upload_file(<EOL>self, content_path, timeout=<NUM_LIT>, custom_headers=None, raw=False, **operation_config):
api_version = "<STR_LIT>"<EOL>url = self.upload_file.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", content_path, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", api_version, '<STR_LIT:str>')<EOL>if timeout is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", timeout, '<STR_LIT>', maximum=<NUM_LIT>, minimum=<NUM_LIT:1>)<EOL><DEDENT>header_parameters = {}<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.put(url, query_parameters, header_parameters)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>raise models.FabricErrorException(self._deserialize, response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(None, response)<EOL>return client_raw_response<EOL><DEDENT>
Uploads contents of the file to the image store.

        Uploads contents of the file to the image store. Use this API if the
        file is small enough to upload again if the connection fails. The
        file's data needs to be added to the request body. The contents will be
        uploaded to the specified path. Image store service uses a mark file to
        indicate the availability of the folder. The mark file is an empty file
        named "_.dir". The mark file is generated by the image store service
        when all files in a folder are uploaded. When using File-by-File
        approach to upload application package in REST, the image store service
        isn't aware of the file hierarchy of the application package; you need
        to create a mark file per folder and upload it last, to let the image
        store service know that the folder is complete.

        :param content_path: Relative path to file or folder in the image
         store from its root.
        :type content_path: str
        :param timeout: The server timeout for performing the operation in
         seconds. This timeout specifies the time duration that the client is
         willing to wait for the requested operation to complete. The default
         value for this parameter is 60 seconds.
        :type timeout: long
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`