cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain a file through webscript

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi all

I have created a webscript in the Web Script Extensions in my alfresco 3.0  community, so introducing the login, password and the node ref of the document, the web script should return the document in a pop up window of the browser

the code of my script is


var scontent="@\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:application/pdf + ";
var qnodeid="@sys\\:node-uuid:"+args.nId;
var strq=scontent+qnodeid;

var content=search.luceneSearch(strq);


// Mostrar error al no encontrar el fichero
if (content.length != 1)
{
   status.code = 404;
   status.message = "File not found.";
   status.redirect = true;
}
model.fichero = content[0];
model.ticket = session.getTicket();
//model.nFact = args.nFact;
//model.cPro = args.cPro;
model.nId = args.nId;
model.strq = strq;


It uses to work fine, but today we have realized that for some documents that exists in the repository with node ref the webscript returns the 404 error message. Even making sure that the noderef id of the document we include in the url call it is fine and it is the one that is stored in Alfresco, the webscript returns this error.

Any ideas why please?

Thanks a lot!!
1 REPLY 1

raghav_bhardwaj
Champ on-the-rise
Champ on-the-rise
It would be easier to assist you if you  can share generated logs here


Raghav Bhardwaj