on 07-06-2007 1:50 PM
Hi All,
I am using the filedownload control in my application , when i run the application i am getting the following error
The initial exception that caused the request to fail, was:
com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=../../../resources/local/FileDownLoad/Components/com.net.Fdownload/<>
at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:601)
at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.applyWSRPTemplate(AbstractURLGenerator.java:1170)
at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.computeWebResourceURL(AbstractURLGenerator.java:1014)
at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.getWebResourceURLInternal(AbstractURLGenerator.java:213)
at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.getWebResourceURLInternal(URLGeneratorInternal.java:284)
I have wrote the following code
IWDAttributeInfo attInfo =
wdContext.getNodeInfo().getAttribute("datasource");
IWDModifiableBinaryType mBinaryType =
(IWDModifiableBinaryType) attInfo.getModifiableSimpleType();
String mFileId = "test";
mBinaryType.setFileName("blah.txt");
mBinaryType.setMimeType(WDWebResourceType.TXT);
Writer output = null;
//use buffering
//FileWriter always assumes default encoding is OK!
try
{
File testFile = new File("C:
Temp
blah.txt");
output = new BufferedWriter( new FileWriter(testFile) );
output.write("dsfsdfsdfdsfs");
output.close();
}
catch (Exception ex)
{
}
finally {
//flush and close both "output" and its underlying FileWriter
//if (output != null) output.close();
}
try
{
FileInputStream FileIn =
new FileInputStream("C:
Temp
blah.txt");
byte Bytes[] = new byte[FileIn.available()];
FileIn.read(Bytes, 0, Bytes.length);
FileIn.close();
wdContext.currentContextElement().setDatasource(Bytes);
}
Can any one tell me what is wrong with the code.
Hallo Sapuser,
do you work with SAP NetWeaver 04 or with NetWeaver 7.0? Nevertheless you must create a Cached Web Resource in NW 04. Please read my corresponding Tutorial.
Regards, Bertram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.