Adding file in S3 from salesforce using S3 API - amazon-s3

I have installed AWS S3 toolkit on sdfc. I have the following code where AWS_S3_ExampleController is part of the installed toolkit. When i execute this code the debug log shows the generic "internal Server error" 500.
The returned soap message has
soapenv:Value>ns1:Client.InvalidArgument soapenv:Value soapenv:Code soapenv:Reasonsoapenv:Text xml:lang="en"Invalid id /soapenv:Text/soapenv:Reason soapenv:Detail ArgumentValue>SAmeer Thakur ArgumentValue>ArgumentName>CanonicalUser/ID/soapenv:Detail>soapenv:Fault> soapenv:Body>soapenv:Envelope>
I do not know how to resolve the Invalid id being seen
AWS_S3_ExampleController c = new AWS_S3_ExampleController();
c.constructor();
c.fileName=fileName;
c.OwnerId='Sameer Thakur';
c.bucketToUploadObject= bucketName;
c.fileSize=100000;
c.fileBlob= Blob.valueOf(record);
c.accessTypeSelected='public-read-write';
System.debug('Before insert');
c.syncFilesystemDoc();
System.debug('After insert');
Any pointer would be appreciated
Thank you
Sameer

The problem was i needed to define ownerid with canonical value.
This value is generated using access key and secret key.
The url to generate canonical user id value is # http://www.bucketexplorer.com/awsutility.aspx
regards
Sameer

Related

WSO2 IS KM JavaException: org.jaggeryjs.scriptengine.exceptions.ScriptException: First Element must contain the local name, Envelope

I am using WSO2 Identity Server Key Manager (wso2is-km), and at im login to dashboard have message
HTTP Status 500 - org.mozilla.javascript.JavaScriptException: JavaException: org.jaggeryjs.scriptengine.exceptions.ScriptException: First Element must contain the local name, Envelope , but found html (/dashboard/controllers/wsUtil.jag#76)
I was solve this issue, please check Log Category on WSO2IS-Km change from DEBUG to INFO

How to rename a file in blob storage by using Azure Datalake Gen2 Rest API

I've try to do the following instruction of this document : LINK
I used SAS authentication and added this to request header "x-ms-rename-source" but i kept getting this error "403-AuthorizationPermissionMismatch". Doing fine with all others api method but this one seem really tricky. Does anyone have success rename a file or directory with this one ?
Instead of using SAS authentication, i used authorization headers. You can check it here.
My request headers :
DateTime now = DateTime.UtcNow;
requestMessage.Headers.Add("x-ms-date", now.ToString("R", CultureInfo.InvariantCulture));
requestMessage.Headers.Add("x-ms-version", "2018-11-09");
//your source path you want to rename
requestMessage.Headers.Add("x-ms-rename-source", renameSourcePath);
//rename operation only accept authorize by shared key via header
requestMessage.Headers.Authorization = AzureStorageAuthenticationHelper.GetAuthorizationHeader(
StorageGen2AccountName, StorageGen2AccountKey, now, requestMessage);
You can try to rename the file in Blob Storage by using Storage Explorer tool
Kindly let us know if the above helps or you need further assistance on this issue.

Can't connect Azure Table Storage to PowerBI (415) Unsupported Media Type)

I'm getting the error below while connecting to Azure Table Storage,
Details:
Blockquote "AzureTables: Request failed: The remote server returned an error:
(415) Unsupported Media Type. (None of the provided media types are
supported)
The one thing I noticed is that if I fill up only the account name it will automatically add the rest of the url which is ".table.core.windows.net" where in the portal its table.cosmosdb.azure.com.
With core.windows.net Im getting err "AzureTables: Request failed: The remote name could not be resolved". But it might messing up some headers while using table.cosmosdb.azure.com
Please advise.
Thank you.
m
You should be able to connect to your azure table storage/CosmosDB account using powerBi using the following link structure: https://STORAGEACCOUNTNAME.table.core.windows.net/ , or https://yourcosmosdbname.documents.azure.com:443/ for cosmosdb
You can get the correct link by going to Portal > go to Storage accounts > Click on Tables/CosmosDB > You'll find the table link you would like to link to powerbi > remove the last table name after "/", then use it to connect in powerbi, it will later allow you to select the specific table in powerBI:
These are screenshots from testing for CosmosDB:
Errors 415:
When it comes to these errors, they can be caused by cache, which can be flushed by going to:
In Power BI Desktop: Go to "File" and select "Options". Under "Data Load" you have the option to clear the cache. After doing this you can use "Get Data" and "OData-feed" as normal and the URL won't return the 415 error
Check the following link for additional suggestions:
Not clear how you consume the table service API, but here is the solution that worked for me for React SPA and fetch api.
Request header must contain:
"Content-Type":"application/json"
It was failing for me with single quotes, and worked with double.

Command Status 0x00000011 with submit_multi for SMPP integration

Hi am integrating with Sybase Mobile 365 Services and I have gotten submit_sm and deliver_sm to work fine. I am trying to get submit_multi to work, but no matter what I try I get back a Command Status = 11. Does anyone have any thoughts as to what that command status means? Why I would get that? I have tried different service types and everything else I can think of... with no success.
Thanks,
Stephen
Command Status = 11 (ESME_RINVDSTADR) means "Invalid destination address".
This mean that probably the the dest_address field in your submit_multi request is wrong.
The dest_address field for submit_multi should be a list of destination address structures as defined in SMPP 3.4 Specification - chapter 4.5.1.1.
The number of destination addresses in the list is set in the number_of_dests field.
Additionally, you could also check that the dest_addr_ton (Type of Number) and dest_addr_npi (Numbering Plan Indicator) are correct for each destination address. For more details about this check out this link.

How can I hotlink/embed a Twitpic image?

So in this URL: http://twitpic.com/2paihn
The Twitpic ID is: 2paihn
And the actual image URL is:
http://s3.amazonaws.com/twitpic/photos/large/163413275.jpg?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&Expires=1284740401&Signature=6lgT6ruyyUDDjLOB7d42XABoCLU%3D
I've tried getting the integer id through the api (i.e. 163413275) and replacing it in the s3.amazon.com url, but this seems to only work some of the time. Most of the time I get an 'access denied' message when I request the amazon-hosted image.
Do you know of another hack to do this?
This is the direct link to the image:
http://twitpic.com/show/full/2paihn
You can use it in an img tag or link it. It will forward to the amazon S3 url with a new expiration date and signature so whoever you're showing it to won't get the access denied message.
Source: http://dev.twitpic.com/docs/thumbnails/
Use http://twitpic.com/show/thumb/<imageid> to get a thumbnail version.