title: 400 Error while uploading blob on Cloud Storage
body: <p>I have created a csv file in Cloud Function. Now, I need to upload it on Cloud Storage. I stored it in /tmp file. From there, I have to upload it on Cloud Storage.</p>
  
  <p>Code used - </p>
  
  <pre><code>def upload_blob(bucket_name, source_file_name, destination_blob_name):
      """Uploads a file to the bucket."""
      storage_client = storage.Client()
      bucket = storage_client.get_bucket(bucket_name)
      blob = bucket.blob(destination_blob_name)
      blob.upload_from_file(source_file_name)
      print('File {} uploaded to {}.'.format(source_file_name,destination_blob_name))
  
  final_df.to_csv('/tmp/'+file_name)
  with open('/tmp/'+file_name, 'r') as file_obj:
      upload_blob('test-bucket',file_obj,file_name)
  </code></pre>
  
  <p>But, I am facing the following error - </p>
  
  <pre><code>BadRequest: 400 PUT https://www.googleapis.com/upload/storage/v1/b/test-bucket/o?uploadType=resumable&amp;upload_id=ABC: ('Request failed with status code', 400, 'Expected one of', &lt;HTTPStatus.OK: 200&gt;, 308)
  </code></pre>
  
  <p>File is getting stored in the /tmp folder. From there, it is not getting uploaded. What exactly can be the error?</p>