Archived from the Transloadit support forum. Originally posted on May 8, 2014; details may be outdated, see our docs for current behavior. Original thread
Hi guys,
I was wondering if there’s a way to have the metadata (similar to s3/import) for the object for s3/store available from the results when using results:true ?
Currently it doesn’t show even though I use results:true
It will also validate if the headers i set for s3 is successful
the /s3/store robot (or other store robots) do not emit results. Instead, they just change the URL of the files in the steps that were piped into them.
Do you have a suggestion to get the metadata of the final file stored using s3/store?
This is because I could run multiple processing steps. As the result returned is a hash, I would not be able to depend on the ordering by checking the last element.
For me the simplest solution is to load that meta in s3/store step instead of storing the entire step sequence ..
As robot conversion steps could get complicated (eg filters, downsampling etc)
I’m only interested in the file-metadata of the final stored file … (steps inbetween are secondary)
Returned results is a hash. (hence unordered)
I would like to access it using the final store step
result[“store-thumbnail”] instead of remembering the last step run “convert-thumbnail_smallest_photo” because its dynamic. Only the final step is fixed as “store-thumbnail”
Maybe i gave a really bad example. I meant that each step is to be chained (use previous step). And i’m only saving the final file.
A better example would be
Step 0 : S3/import
Step 1 : Watermark
Step 2 : Video Resize
Step 3 : S3/store
Programatically the each step chained are just added dynamically without being tracked..
And i only want the metadata of the
Step 0 : S3/import
and
Step 3 : S3/store
response.results returns a Unordered Hash in ruby. Its ordering isn’t reliable.
I manage to get the original file metadata through the “import” results. However I was wondering if i can get the metadata from the “export” result?
our store robots do not trigger results by themselves. The only thing that they do is they change the URL in the meta data of the steps that were passed into them.
So if you examine the results of the Video Resize step, it will have all the meta data, and its “url” property will point to an URL on Amazon S3.
Does this make sense? We know that this is a little confusing and we might change it in a future API version.
its a little counter intuitive.. instead of modifying the metadata (url) of the previous step.
Why don’t you copy the previous metadata instead and change the url in the current s3/store step?
yeah, we agree it’s confusing, especially for newcomers to Transloadit. We’ll talk to more customers about it and then may address it in future API changes.
Example usecase scenario: allow to upload either image or video, use robot to process each, store gets input from either one or another,
I want to be able to parse result[:store] for the url instead or trying both result[:image] and result[:video] - which would help as I process more and more files for storage.