Hello there!
I have some sad issue with rusian file names and names with blank spaces on 
google cloud storage. Sorry for posting this message here, but GCS haven't 
their own group.

My problem is:

When i store files in GCS with names, that contain blank spaces or russian 
character in their name, I can't delete them, using REST API.

My batch delete method is:

def gcs_batch_delete(gcs_file_names):
 logging.debug('Deleting ' + str(len(gcs_file_names)) + ' files.')

 boundary = '===============7330845974216740156=='
 headers = {'Content-Type': 'multipart/mixed; boundary="' + boundary + '"'}
 data = '--' + boundary + '\n'
 template = """Content-Type: application/http

DELETE /storage/v1/b/%s/o/""" % os.environ['GCS_BUCKET_NAME']
 bodies = [template + urllib.quote_plus(filename) + '\n' for filename in 
gcs_file_names]
 data += ('\n--' + boundary + '\n').join(bodies)
 data += '\n--' + boundary + '\n'

 logging.debug('Request:\n' + data)

 url = 'https://www.googleapis.com/batch'
 result = urlfetch.fetch(url=url, payload=data, method=urlfetch.POST, 
headers=headers)

 logging.debug('urlfetch result: ' + str(result.content))

One moment here:  I can't store files in GCS with names, that differ from 
original name.


So, i need to make a nice looking request to GCS to perform my batch delete. 

In this request file name must be exactly as it written to GCS.
Already asking this on overflow, but nothing helped. 


Hope, guys, u can help me to solve my problem :3



-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/eeace13c-e77a-4f90-9279-0aa4c2e44c74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to