A Photo Stream For the Cloud using ASP.NET MVC and Azure Blob Storage - blob

The remote server returned an error: (400) Bad Request. on upload
var container = CloudStorageAccount.Parse(
ConfigurationManager.AppSettings["StorageConnectionString"]).CreateCloudBlobClient()
.GetContainerReference(Request.RequestContext.HttpContext.User.Identity.Name);
container.CreateIfNotExists();

There might be an issue with container name which you are referring (i.e. Request.RequestContext.HttpContext.User.Identity.Name).
A container name must be a valid DNS name, conforming to the following naming rules:
Container names must start with a letter or number, and can contain only letters,
numbers, and the dash (-) character.
Every dash (-) character must be immediately preceded and followed by a letter or
number; consecutive dashes are not permitted in container names.
All letters in a container name must be lowercase.
Container names must be from 3 through 63 characters long.
For more information please go to this link.
Hope this helps.
Thanks

Related

How can I pass deployment properties that contain comma separated values?

The issue I am facing is similar to the one described here:
https://github.com/spring-cloud/spring-cloud-dataflow/issues/1826
This seems to have been closed with a code change.
But I am not sure if this change applied to deployment properties also.
I tried separating out the properties with a space, but it didn't work.
Here is my stream definition sample:
stream create --name testFileStream --definition "file --directory=/input --mode=ref --filename-pattern=TEST*.DAT | tasklaunchprocessor --task.launch.request.task-name=test-task --task.launch.request.arg-expressions=localFilePath=payload.substring(1,payload.length()-1) --task.launch.request.deployment-properties=app.test.input.fileArchiveDirectory=/archive, app.test.fileOutputDirectory=/output, app.test.expiryNotificationDays=14,30 app.disclosure.spring.batch.job.names=testFileLoadAndProcess | dataflow-tasklauncher --server-uri=http://scdf-spring-cloud-dataflow-server:8080"
For the property 'app.test.expiryNotificationDays', I have a comma separated list of values (14,30 in this case).
And I separated each property by a space.
But when I try to create this stream through SCDF CLI, it throws an error:
Found unexpected data after stream definition: 'app'
It is pointing to the blank space. So, looks like blank space between each deployment property is not acceptable.
Is there any way of passing two values (separated by a comma) to a property?

Passing encoded url string containing %3A (colon) to an APEX page truncates everting after the last %3A

I am using ORACLE APEX 5.0.1
I am passing an url string to an APEX application where I have encoded all special caracters, if there is one or more %3A (colon) in the url APEX seemes to truncate the value I am passing.
This affects only the last variable I am passing and only the remaining part after the last %3A, but if I place a %3A at the very end of the url it works in APEX.
I have asked about this in other forums and it seems to be a relative unknown issue in APEX, haven't got any relevant answer that explains the issue.
This example pass values to tre fields
"...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,VMKF%3AU%202012%3A50"
P32_XX, and P32_YY get the value ok
P32_ZZ only get the value "VMKF:U 2012"
but if I put a %3A at the end of the url like this
"...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,VMKF%3AU%202012%3A50%3A"
it works ok and P32_ZZ gets the value "VMKF:U 2012:50".
I have tested this in Windows Explorer 11, Google Crom and Mozilla Firefox (latest version) with the same behavior.
And I have the same behaviour if I use a literal colon (:)
Appreciate the help
The issue is that the colon is a separator for the different parts of the APEX URL. I am surprised that using %3F doesn't fix it, but the solution is to surround the whole value by \...\ like this:
...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,\VMKF%3AU%202012%3A50\
Note that you don't even need to escape the colons now:
...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,\VMKF:U%202012:50\

Specifying multiple Domain Bases in Rocket.Chat LDAP

On Rocket.Chat's LDAP configuration page, the helper text for Domain Base states that you should enter (emphasis mine):
The fully qualified Distinguished Name (DN) of an LDAP subtree you want to search for users and groups. You can add as many as you like; however, each group must be defined in the same domain base as the users that belong to it. If you specify restricted user groups, only users that belong to those groups will be in scope. We recommend that you specify the top level of your LDAP directory tree as your domain base and use search filter to control access.
Problem is, I don't know how to enter more than one.
My DN looks like this:
OU=IT,OU=Staff,DC=companyname,DC=local
And I want the following users to also be synced:
OU=Example,OU=Staff,DC=companyname,DC=local
But I don't know how to add them both, as the docs aren't clear, and the source code is even less clear.
I've tried the following ways:
Space separated
Semicolon separated
Ampersand (and double ampersand) separated
Wrapping them up in an array (e.g. ["OU=Example ...", "OU=IT ..."]) and as a JSON object
Pipe (and double pipe) separated
'Plus' separated (e.g. DC=local + OU=Example)
But no matter what I do, it won't sync users. The logs tell me:
Exception while invoking method 'ldap_sync_users' NoSuchObjectError: 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of: at Object.Future.wait (/snap/rocketchat-server/511/node_modules/fibers/future.js:449:15) ...
I know I can set up a group restriction so only users in a certain group will be synced, but the helper text says I can use multiple DNs, and I want to know how to use multiple DNs
After reading RFC-4514, I discovered I should construct my DN like so:
OU=Example+OU=IT,OU=Staff,DC=companyname,DC=local
With the plus occurring between the two OUs I wish to add. Now my users are syncing correctly.

Alfresco FTS - why first digit of folder's name should be escaped?

I have a question regarding the alfresco FTS/lucene search. It is known that in the search query some special characters have to be escaped, like space (by _x0020_).
But it turned out that if folder's name first chatacter is a digit, it should also be escaped. It can be easily tested in Node Browser by creating a folder, like 123456 and navigate to the parent folder in node browser (in my case I have following folder structure: */2017/123456/):
Primary Path: /app:company_home/st:sites/<some-folders>/cm:_x0032_017/cm:_x0031_23456
^this is 2 ^ and this is 1
If I don't ecape first character of the folder I have 500 error returned.
Why is that, I tried to find something relevant in Alfresco documentation, but didn't manage to.
Alfresco v.4.2.0
Lucene search uses ISO 9075 codification (SQL) like similar frameworks, so we need to encode the path elements. It would be nice if the API hides this requirement like the browser url but you could use ISO9075Encode to do the job.

Are colons allowed in URLs?

I thought using colons in URIs was "illegal". Then I saw that vimeo.com is using URIs like http://www.vimeo.com/tag:sample.
What do you feel about the usage of colons in URIs?
How do I make my Apache server work with the "colon" syntax because now it's throwing the "Access forbidden!" error when there is a colon in the first segment of the URI?
Colons are allowed in the URI path. But you need to be careful when writing relative URI paths with a colon since it is not allowed when used like this:
<a href="tag:sample">
In this case tag would be interpreted as the URI’s scheme. Instead you need to write it like this:
<a href="./tag:sample">
Are colons allowed in URLs?
Yes, unless it's in the first path segment of a relative-path reference
So for example you can have a URL like this:
https://en.wikipedia.org/wiki/Template:Welcome
And you can use it normally as an absolute URL or some relative variants:
Welcome Template
Welcome Template
Welcome Template
But this would be invalid:
Welcome Template
because the "Template" here would be mistaken for the protocol scheme.
You would have to use:
Welcome Template
to use a relative link from a page on the same level in the hierarchy.
The spec
See the RFC 3986, Section 3.3:
https://www.rfc-editor.org/rfc/rfc3986#section-3.3
The path component contains data, usually organized in hierarchical
form, that, along with data in the non-hierarchical query component
(Section 3.4), serves to identify a resource within the scope of the
URI's scheme and naming authority (if any). The path is terminated
by the first question mark ("?") or number sign ("#") character, or
by the end of the URI.
If a URI contains an authority component, then the path component
must either be empty or begin with a slash ("/") character. If a URI
does not contain an authority component, then the path cannot begin
with two slash characters ("//"). In addition, a URI reference
(Section 4.1) may be a relative-path reference, in which case the
first path segment cannot contain a colon (":") character. The ABNF
requires five separate rules to disambiguate these cases, only one of
which will match the path substring within a given URI reference. We
use the generic term "path component" to describe the URI substring
matched by the parser to one of these rules. [emphasis added]
Example URL that uses a colon:
https://en.wikipedia.org/wiki/Template:Welcome
Also note the difference between Apache on Linux and Windows. Apache on Windows somehow doesn't allow colons to be used in the first part of the URL. Linux has no problem with this, however.