Getting file using ObjectsResource_GetMethod

13 views
Skip to first unread message

for...@prenav.com

unread,
Apr 26, 2018, 10:33:47 PM4/26/18
to Google APIs Client Library for C++
I am having a strange problem with ObjectsResource_GetMethod.  I can list the contents of the bucket using ObjectsResource_ListMethod and I successfully GET an object that does not have a '/' in the name.  The object list is


I can get checker.exr using the GetMethod interface, but I cannot get the TestSubDirectory/INSPECT_L_0000001.cam file.  I encode the object name as TestSubDirectory%2FINSPECT_L_0000001.cam and invoke

ObjectsResource_GetMethod(storage, &credential, "pn_test_bucket", object_name);

When object_name is "checker.exr", everything is fine - but the encoded name does not work.  I tried specifying the entire path name


with no luck.  I also tried changing %2F back to '/' also with no luck.

Anyone with any ideas?

Tony Aiuto

unread,
Apr 26, 2018, 10:46:20 PM4/26/18
to for...@prenav.com, Google APIs Client Library for C++
It's hard to tell if this is an issue with the library, your code or Google Cloud Store. (At least, I think you might be using GCS since you say "bucket").

The diagnosis I would try is:
  1. Use the GCS web console to see if it really is a / is in the name, or if it got converted to %2F on file create.
  2. If it is really / then maybe your app or the library
    1. is converting / to %2F while doing the request and GCS is expecting /
    2. is converting %2F to %252F while doing the request (I would guess that)
  3. Or GCS is really using 2F
    1. then / is wrong for the request
    2. and if you try %2F, I bet the behavior in 2.2 comes into play

You should also try the help lists for Google Cloud Storage, that may be the most informative place.


 



--
You received this message because you are subscribed to the Google Groups "Google APIs Client Library for C++" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-api-cpp-c...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Forest Rouse

unread,
Apr 27, 2018, 12:19:42 AM4/27/18
to Tony Aiuto, Google APIs Client Library for C++
Dear Tony:

Thanks for the feedback.  When I use ListMethods, I get %2F in the file name for '/'.  That is why I first tried to convert / to %2F for the GetMethod.  Since that did not work, I tried / and that did not work either.  I am working around the problem by doing a ListMethods with the prefix as the object name without the conversion of / to %2F and then using the obj that matches the name.  It's not the best of situations, but it does get us around the problem for now.

Forest

To unsubscribe from this group and stop receiving emails from it, send an email to google-api-cpp-client+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Forest Rouse, PhD
Principle Software Engineer, PreNav
Reply all
Reply to author
Forward
0 new messages