on 02-28-2009 6:04 PM
Hi All,
I was reading the following blog /people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis and I was trying to upload a document from a URL for example http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif
So far I am getting the following error:
http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif (No such file or directory (errno:2))
Any Ideas?
Regards,
Orlando Covault
Plz see the below thread for help
https://forums.sdn.sap.com/click.jspa?searchID=22955072&messageID=6974995
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
use th following link,
Regards
Jay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jay,
So far I think I followed all the intructions given in the links you provide. This is the snipped code
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
String path = "/documents";
IResourceContext resourceContext = buildResourceContext();
// get a resource factory
IResourceFactory resourceFactory = ResourceFactory.getInstance();
// Get a RID from the current path to display the according content
RID pathRID = RID.getRID(path);
// Get a Iresource object to work on
ICollection folder =
(ICollection) resourceFactory.getResource(
pathRID,
resourceContext);
String templateUrl =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
"PositionModPDFView_InteractiveForm.xdp");
File file = new File(templateUrl);
FileInputStream template = new FileInputStream(file);
manager.reportWarning(template.toString());
if (template != null) {
template.read();
Content content = new Content(template, "byte", -1L);
manager.reportWarning(content.getContentType());
IResource newResource =
folder.createResource("sap_logo1.gif", null, content);
template.close();
}else{
manager.reportException("Documento Vacio",false);
}
} catch (ResourceException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (IOException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (ContentException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (WDAliasResolvingException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
}
But I am still getting the same error: http://ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif(No such file or directory (errno:2)) . Any Idea of what could be wriong?
Regards,
Orlando Covault
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.