cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Upload document with whitespaces

mbarrerag
Champ in-the-making
Champ in-the-making
Hello everybody,

Is it possible to use whitespaces in the document's name and then download the document using the java webservice??…. Here is an example of my code:

Reference ref = new Reference(STORE, null, folder.getPath()
               + "/cm:" + name);
         Content[] read = getContentService().read(
               new Predicate(new Reference[] { ref }, STORE, null),
               Constants.PROP_CONTENT);
         content = read[0];

The value of name is "Exmple foo bar.pdf" so the path of the new Reference is : /api/cmSmiley Frustratedpace/cm:Test/cm:Example foo bar.pdf

The name is correct and also the path is correct, but when it tries to read the content thows an axis exception.

Thanks in advance
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
paths need to be ISO9075 encoded.

mbarrerag
Champ in-the-making
Champ in-the-making
Yes thankyou i found a solution fixing the document's name as follows:

name= name.replace(" ", "_x0020_");