AnsweredAssumed Answered

Obtain a file through webscript

Question asked by jlabuelo on Aug 31, 2015
Latest reply on Sep 29, 2015 by raghav.bhardwaj
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\\://\\}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!!