What is the response from the REST API when you attempt to delete?

have you tried the gcloud command line tool?  does it fail in the same way?

my only thought is encoding or escaping the special characters is the 
problem.  I am curious about the answer!

good luck,

cfh

On Friday, May 13, 2016 at 5:36:31 AM UTC-7, Никита Гуртовой wrote:
>
>
> 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/42106ae8-9942-41db-bbc2-599797567eb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to